Skip to main content

schema-content-media-type-exists-for-content-schema

Overview

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

The property contentSchema should only be used when the property contentMediaType is also set in the same Schema Object. If contentMediaType is not present, contentSchema will be ignored.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageMissing corresponding contentMediaType property in the Schema Object for contentSchema.
CodeOPENAPI3STANDARDS_L189
TypeLinting
Rule SystemSemantic
Broad CategorySchemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic linting content media type content schema media type schema

Suggested Fixes

  • Define the property contentMediaType in the Schema Object along with contentSchema.
  • Remove the property contentSchema from the Schema Object if contentMediaType property is not expected to be set.

For More Information