valid-media-type-example
Overview
This rule belongs to the openapi-v3-docsgen-linting
ruleset and states that:
The example value specified for a Media Type Object using either the example
property or examples
must be valid for the given schema definition.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | Media type object example does not conform to its schema definition. |
Code | OPENAPI3DOCSGEN_L461 |
Type | Linting |
Rule System | Semantic |
Broad Category | OpenAPI Media Types |
Products Impacted | Developer Experience Portal |
Tags | documentation generation documentation docs openapi3 openapi semantic linting apimatic examples example value media type schema |
Suggested Fixes
- Ensure that media type example value conforms to the media type's schema 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.
For More Information
- https://www.apimatic.io/
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#media-type-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object
- https://docs.apimatic.io/rulesets/overview/