Ensures there are no required schema properties that are undefined.
| OAS | Compatibility |
|---|---|
| 2.0 | ✅ |
| 3.0 | ✅ |
| 3.1 | ✅ |
| 3.2 | ✅ |
| AsyncAPI | Compatibility |
|---|---|
| 2.6 | ✅ |
| 3.0 | ✅ |
| Arazzo | Compatibility |
|---|---|
| 1.0 | ✅ |
If a required schema property is declared but not defined, this rule informs you which of the required schema properties are missing.
| Option | Type | Description |
|---|---|---|
| severity | string | Possible values: off, warn, error. Default warn (in recommended configuration). |
An example configuration:
rules:
no-required-schema-properties-undefined: errorGiven this configuration:
rules:
no-required-schema-properties-undefined: errorExample of incorrect schema properties:
schemas:
Pet:
type: object
required:
- id
- name
properties:
id:
type: integer
format: int64Expected error message when linting incorrect schema example:
Required property 'name' is undefined.Example of correct schema properties:
schemas:
Pet:
type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
example: doggieThe rule is case-sensitive, which means a property name does not match the string Name in the required list:
schemas:
Pet:
type: object
properties:
name:
type: string
required:
- NameThe rule also accepts composed types as correct.
schemas:
Pet:
type: object
anyOf:
- required:
- id
- required:
- name
properties:
id:
type: integer
format: int64
name:
type: string
example: doggie