Description
responses accepts individual HTTP status codes, including informational 1xx codes. default covers codes without a more specific entry. OpenAPI 3.0 also accepts the uppercase ranges 1XX through 5XX. OpenAPI 2.0 has no range syntax.
Potential impact
Tools may reject malformed keys. A valid code with the wrong meaning can also lead clients to mishandle a redirect or an error.
Remediation
List the codes your server returns. Check their meanings in the IANA registry, then validate the full document against its OpenAPI version.
Response-key examples
These OpenAPI 3.0 excerpts omit info.
Invalid response keys
{
"openapi": "3.0.0",
"paths": {
"/": {
"get": {
"responses": {
"50": {
"description": "Invalid status"
},
"6xx": {
"description": "Invalid range"
}
}
}
}
}
}
Status codes whose meaning needs review
{
"openapi": "3.0.0",
"paths": {
"/": {
"get": {
"responses": {
"200": {
"description": "OK"
},
"310": {
"description": "Redirect"
}
}
}
}
}
}
50 is too short and 6xx is outside the allowed ranges. 200 means success. 310 has no registered meaning. For a redirect, use the code the server sends, such as 301 or 302.