Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageMedia type object example does not conform to its schema definition.
CodeOPENAPI3DOCSGEN_L461
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Media Types
Products ImpactedDeveloper Experience Portal
Tagsdocumentation 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