Skip to main content

request-body-encoding-only-for-form-media-types

Overview

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

A Request Body Object can only define encoding information for its content if the media type of the content is specified as multipart or application/x-www-form-urlencoded.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageEncoding information is not applicable for the current Request Body Object media type.
CodeOPENAPI3STANDARDS_V135
TypeValidation
Rule SystemSemantic
Broad CategoryMedia Types
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation encoding form request body body media type

Suggested Fixes

  • Remove property encoding from the Media Type Object referenced in the Request Body Object if the corresponding media type is not multipart or application/x-www-form-urlencoded.
  • Make sure you are referencing the correct Media Type Object in the Request Body Object content map.

For More Information