request-body-encoding-style-only-for-form-url-encoded-media-type
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
In an OpenAPI v3.0.x document, the Encoding Object referenced by a Request Body Object content definition must define style
only if the content media type is set as application/x-www-form-urlencoded
. If style
is defined for a different request body media type, it will be ignored.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | Property style in the Encoding Object is not applicable for current request body media type. |
Code | OPENAPI3STANDARDS_V151 |
Type | Validation |
Rule System | Semantic |
Broad Category | Encoding |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation style encoding request body url encoded media type |
Suggested Fixes
- Remove property
style
from the Encoding Object. - Ensure that the Encoding Object is defined inside a media type definition that supports configuration of encoding style.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#encoding-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#request-body-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#media-type-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/