‘Responses’ object must contain at least one HTTP response code key or the value ‘default’

Description

One or more responses objects in your API are empty. Responses objects must contain at least one HTTP response code key or the value default.

Example

The following is how this issue could look in your API definition:

"post": {
  "description": "Creates a new pet in the store",
  "operationId": "addPet",
  ...
  "responses": {
    }
  }

Remediation

Make sure that all responses objects have a HTTP response code key defined or the value default.

"post": {
  "description": "Creates a new pet in the store",
  "operationId": "addPet",
  ...
  "responses": {
    "200": {
    "description": "Expected response to a valid request",
    "schema": {
      "$ref": "#/definitions/Pets"
      }
    }
  ...
  }
}

Get API Security news directly in your Inbox.

By clicking Subscribe you agree to our Data Policy