valid-encoding-style
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The encoding style behavior follows the same values as those allowed for query parameters, including default values. Therefore, the property style
in an Encoding Object can have only one of the following possible values: form
, spaceDelimited
, pipeDelimited
or deepObject
. All other values will be treated as invalid.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Value provided for encoding style is invalid. |
Code | OPENAPI3STANDARDS_V147 |
Type | Validation |
Rule System | Semantic |
Broad Category | Encoding |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation style serialization property encoding |
Suggested Fixes
- Encoding style value is compared in a case-sensitive manner.
- Ensure that the style value matches exactly with the possible list of values and that there are no typos:
form
,spaceDelimited
,pipeDelimited
ordeepObject
. - Ensure that the value for style is not null or empty.
For More Information
- 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.1.0.md#style-values
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-object
- 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#style-values
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameter-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/