Skip to main content

no-content-type-header-parameter-definition

Overview

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

The parameters list must not contain an explicit definition for the Content-Type header parameter. If a definition is added, it will be ignored.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageDefinition for Content-Type header parameter found.
CodeOPENAPI3STANDARDS_V084
TypeValidation
Rule SystemSemantic
Broad CategoryParameters
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation content type header parameter

Suggested Fixes

  • Ensure that the parameters list does not contain a parameter named Content-Type with location set as header.
  • Remove the entry for parameter named Content-Type from the parameters list.
  • Use the request body level content media types to convey the information related to expected media types.

For More Information