valid-schema-examples
Overview
This rule belongs to the openapi-v3-standards-linting
ruleset and states that:
Each of the example provided for a Schema Object using the examples
property should be valid for the type definition of that schema.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | Example value provided in the Schema Object examples list is not valid. |
Code | OPENAPI3STANDARDS_L191 |
Type | Linting |
Rule System | Semantic |
Broad Category | Schemas |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic linting examples example schema |
Suggested Fixes
- Ensure that the example provided in the schema examples list conforms to the schema type definition.
- Check that no required properties are missing in the example value.
- Check that types of all properties match those specified in the schema definition.