unique-response-http-status-code
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
Response keys are patterned fields that must have unique values within the Responses Object. The keys represent the HTTP status code/range for each response.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Duplicate response status code/range entry found. |
Code | OPENAPI3STANDARDS_V195 |
Type | Validation |
Rule System | Semantic |
Broad Category | Responses |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation responses status code status range status http |
Suggested Fixes
- Remove duplicate response status code/range entries from the Responses Object.
- Response key value is compared in a case-sensitive manner.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#patterned-fields-1
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#responses-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#format
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#patterned-fields-1
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#responses-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#format
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/