Skip to main content

media-type-examples-override-media-schema-example

Overview

This rule belongs to the openapi-v3-standards-validation ruleset and states that:

An example for a media type can be provided in two ways: either directly in the Media Type Object using the examples property or in the Schema Object definition when specifying the media type level schema property. If an example is provided at both levels, the Media Type Object level examples will override the Schema Object level example.

PropertyValue
EnabledYes
Maximum SeverityInformation
MessageMedia Type level examples found that override the example present in the media type's schema definition.
CodeOPENAPI3STANDARDS_V133
TypeValidation
Rule SystemSemantic
Broad CategoryMedia Types
Products ImpactedAPI Transformer, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation examples media type schema

Suggested Fixes

  • If the Schema Object does not add any new example value as compared to the Media Type Object examples, and the schema is inline, it might be a good idea to remove the schema level example.

For More Information