unique-case-insensitive-response-header-names
Overview
This rule belongs to the openapi-v3-standards-linting
ruleset and states that:
The response headers list can contain the expected headers that can be received as part of the response. 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_L102 |
Type | Linting |
Rule System | Semantic |
Broad Category | Responses |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic linting name header response |
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#response-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#response-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/