no-content-type-with-encoding-allow-reserved
Overview
This rule belongs to the openapi-v3-standards-validation ruleset and states that:
If the encoding configuration allows for reserved characters using the Encoding Object's allowReserved property, then the value of property contentType (implicit or explicit) will be ignored.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Warning |
| Message | Encoding allowReserved is defined, therefore, the value of contentType will be ignored. |
| Code | OPENAPI3STANDARDS_V156 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Encoding |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi standards semantic validation content type allow reserved serialization property encoding |
Suggested Fixes
- Remove the
allowReservedproperty from the Encoding Object. - If you want the
contentTypeinformation to be effective, remove theallowReservedinformation from the Encoding Object instead.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#encodingContentType
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#encodingAllowReserved
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#encoding-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/