Skip to main content

media-type-encoding-property-exists-in-schema

Overview

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

If encoding information is provided for a Media Type Object, the encoding key must indicate name of the property which needs to be encoded. The property indicated this way must be pre-defined in the definition of the property schema of the Media Type Object.

PropertyValue
EnabledYes
Maximum SeverityError
MessageProperty name specified in encoding map of the Media Type Object is not defined in its schema definition.
CodeOPENAPI3STANDARDS_V134
TypeValidation
Rule SystemSemantic
Broad CategoryMedia Types
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation property encoding media type schema

Suggested Fixes

  • The Schema Object referenced in the schema property of the Media Type Object must consist of a definition for the property in its properties list.
  • The name of the property specified in the encoding information of Media Type Object must match exactly with the name of the property in the schema definition.
  • Names are compared in a case-sensitive manner.
  • If you do not wish to add a schema level entry for the property, remove entry for the property from the encoding information of the Media Type Object.

For More Information