unique-case-insensitive-header-parameter-names
Overview
This rule belongs to the openapi-v3-standards-linting
ruleset and states that:
The parameters list can contain custom headers that are expected as part of the request. There can only be a single entry for each header in this list. Since the header names are case insensitive as per RFC7230 they will be compared accordingly.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | A definition for this header parameter already exists. |
Code | OPENAPI3STANDARDS_L060 |
Type | Linting |
Rule System | Semantic |
Broad Category | Parameters |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic linting name header parameter |
Suggested Fixes
- Remove duplicate entries for the header in the list.
- Header names are compared in a case-insensitive manner. This means that headers named
content-type
andContent-Type
are considered equal.
For More Information
- 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#parameter-object
- https://tools.ietf.org/html/rfc7230#page-22
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md
- https://docs.apimatic.io/rulesets/overview/