Requires that the contents of every enum value in your API description conform to the corresponding schema's specified type.
| OAS | Compatibility |
|---|---|
| 2.0 | ✅ |
| 3.0 | ✅ |
| 3.1 | ✅ |
| 3.2 | ✅ |
| AsyncAPI | Compatibility |
|---|---|
| 2.6 | ✅ |
| 3.0 | ✅ |
| Arazzo | Compatibility |
|---|---|
| 1.0 | ✅ |
If a property is defined for a certain type, then its corresponding enum values should comply with that type. Lack of compliance is most likely the result of a typo.
| Option | Type | Description |
|---|---|---|
| severity | string | Possible values: off, warn, error. Default error (in recommended configuration). |
An example configuration:
rules:
no-enum-type-mismatch: errorGiven this configuration:
rules:
no-enum-type-mismatch: errorExample of incorrect enum values given the enum type:
properties:
huntingSkill:
type: string
description: The measured skill for hunting
enum:
- adventurous
- 12
- 3.14Example of correct enum values given the enum type:
properties:
huntingSkill:
type: string
description: The measured skill for hunting
enum:
- adventurous
- aggressive
- passive- no-schema-type-mismatch
- no-required-schema-properties-undefined
- configurable rules
- no-invalid-media-type-examples
- no-invalid-parameter-examples
- no-invalid-schema-examples