no-accept-header-parameter-definition
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The parameters list must not contain an explicit definition for the Accept
header parameter. If a definition is added, it will be ignored.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | Definition for Accept header parameter found. |
Code | OPENAPI3STANDARDS_V083 |
Type | Validation |
Rule System | Semantic |
Broad Category | Parameters |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation accept header parameter |
Suggested Fixes
- Ensure that the parameters list does not contain a parameter named
Accept
with location set asheader
. - Remove the entry for parameter named
Accept
from the parameters list. - Use the responses level content media types to convey the information related to expected/acceptable media types.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#fixed-fields-10
- 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#fixed-fields-10
- 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/