valid-schema-example
Overview
This rule belongs to the openapi-v3-docsgen-linting
ruleset and states that:
The example value specified for the Schema Object using the example
property must be valid for the type definition of that schema.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | Schema object example does not conform to its type definition. |
Code | OPENAPI3DOCSGEN_L755 |
Type | Linting |
Rule System | Semantic |
Broad Category | OpenAPI Schemas |
Products Impacted | Developer Experience Portal |
Tags | documentation generation documentation docs openapi3 openapi semantic linting apimatic example value schema |
Suggested Fixes
- Ensure that schema example value conforms to the schema type definition.
- Check that no required properties are missing in the sample value.
- Check that types of all properties match those specified in the schema definition.