header-simple-style-only-for-array-type
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The simple
style can only be used when the type of the header is set as array
i.e. it cannot be used for primitive or object types.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Simple style cannot be used with the current header type. |
Code | OPENAPI3STANDARDS_V248 |
Type | Validation |
Rule System | Semantic |
Broad Category | Headers |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation simple style array serialization header |
Suggested Fixes
- Ensure that the
type
of the header set in either the header's schema or content definition is equal toarray
. - If the header type is not expected to be an array, simply remove the
style
property definition.
For More Information
- 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#header-object
- 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#style-values
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#header-object
- 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/