HTTP status codes in responses must be between 100 and 599

Issue ID: semantic-response-httpstatus

Description

One or more responses objects in your API have non-standard HTTP response code keys. The HTTP response code keys must be between 100 and 599.

For more details, see the OpenAPI Specification.

Example

The following is an example of how this issue could look in your API definition. Here, the response code has a typo and is missing one number:

{
    "responses": {
        "20": {
            "description": "Expected response to a valid request",
            "schema": {
                "$ref": "#/definitions/Pets"
            }
        }
    }
}

Or your response code might be bigger than the maximum defined in the Hypertext Transfer Protocol (HTTP) Status Code Registry:

{
    "responses": {
        "659": {
            "description": "Response to the error XYZ",
            "schema": {
                "$ref": "#/definitions/Pets"
            }
        }
    }
}

Remediation

Make sure that all responses objects have HTTP response code keys between 100 and 599.

{
    "responses": {
        "200": {
            "description": "Expected response to a valid request",
            "schema": {
                "$ref": "#/definitions/Pets"
            }
        }
    }
}