make sure types are declared in spec linter

This commit is contained in:
Min RK
2024-02-07 15:32:53 +01:00
parent 9a75622ee5
commit 5cddce343d
2 changed files with 44 additions and 0 deletions

View File

@@ -1465,6 +1465,7 @@ paths:
content: content:
application/x-www-form-urlencoded: application/x-www-form-urlencoded:
schema: schema:
type: object
required: required:
- client_id - client_id
- client_secret - client_secret
@@ -1481,6 +1482,8 @@ paths:
grant_type: grant_type:
type: string type: string
description: The grant type (always 'authorization_code') description: The grant type (always 'authorization_code')
enum:
- authorization_code
code: code:
type: string type: string
description: The code provided by the authorization redirect description: The code provided by the authorization redirect

View File

@@ -7,3 +7,44 @@ apis:
rules: rules:
info-license-url: off info-license-url: off
operation-4xx-response: off operation-4xx-response: off
# custom rules
# https://redocly.com/docs/cli/rules/configurable-rules/
rules:
rule/required-items-in-array-schemas:
subject:
type: Schema
assertions:
required:
- items
where:
- subject:
type: Schema
property: type
assertions:
const: array
defined: true
message: The 'items' field is required for schemas of array type.
rule/require-schema-type:
subject:
type: Schema
property: type
assertions:
defined: true
message: schema missing type
where:
# don't require type on schemas that reference other schemas, which already must specify type
- subject:
type: Schema
property: allOf
assertions:
defined: false
rule/require-parameter-schema:
subject:
type: Parameter
property: schema
assertions:
defined: true
message: Parameter missing schema