Disallow invalid schema examples.
| OAS | Compatibility | 
|---|---|
| 2.0 | ✅ | 
| 3.0 | ✅ | 
| 3.1 | ✅ | 
| 3.2 | ✅ | 
If your schema and example conflict, there is a problem in the definition of the schema or the example. Solve it before you ship it.
| Option | Type | Description | 
|---|---|---|
| severity | string | Possible values: off, warn, error. Default warn. | 
| allowAdditionalProperties | boolean | Determines if additional properties are allowed in examples. Default false. | 
An example configuration:
rules:
  no-invalid-schema-examples:
    severity: error
    allowAdditionalProperties: falseGiven the following configuration:
rules:
  no-invalid-schema-examples:
    severity: error
    allowAdditionalProperties: falseExample of incorrect schema example:
components:
  schemas:
    Car:
      type: object
      properties:
        color:
          type: string
          example: 3.14Example of correct parameter example:
components:
  schemas:
    Car:
      type: object
      properties:
        color:
          type: string
          example: red