Skip to main content

no-content-type-header-in-encoding-headers

Overview

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

The Content-Type header must not be explicitly defined in the Encoding Object headers section as it is described separately in the contentType section of the Encoding Object. If a definition is found, it will be ignored.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageContent-Type header definition found in encoding headers section.
CodeOPENAPI3STANDARDS_V145
TypeValidation
Rule SystemSemantic
Broad CategoryEncoding
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation headers content type encoding

Suggested Fixes

  • Remove the header named Content-Type from the Encoding Object headers list.
  • Relocate the Content-Type information to the contentType property in the same Encoding Object.

For More Information