Skip to main content

request-body-encoding-headers-only-for-multipart-media-type

Overview

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

The Encoding Object referenced by a Request Body Object content definition must define headers only if the content has a multipart media type e.g. multipart/form-data. If headers are defined for a different request body media type, their definition will be ignored.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageProperty headers in the Encoding Object is not applicable for current request body media type.
CodeOPENAPI3STANDARDS_V146
TypeValidation
Rule SystemSemantic
Broad CategoryEncoding
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation headers encoding request body multipart media type

Suggested Fixes

  • Remove property headers from the Encoding Object.
  • Ensure that the Encoding Object is defined inside a media type definition that supports encoding headers.

For More Information