Skip to main content

no-content-type-response-header-definition

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 Response Object headers section as the content section is dedicated for adding this information. If a definition is found, it will be ignored.

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

Suggested Fixes

  • Remove the header named Content-Type from the Response Object headers list.
  • Provide the information related to expected/allowed response content types using the Response Object content section.

For More Information