Response reference does not exist (OpenAPI 2.0)

A shared response reference does not match an existing definition

Description

A #/responses/... reference must point to an existing shared response. If the target is missing, the operation cannot load its response description and body structure.

Potential impact

Documentation or client code generation may fail, or response information may be omitted.

Remediation

Match $ref to the name in responses, including letter case. Update referring operations when renaming or removing a response definition.

Examples

These examples correct the misspelled Succes to the actual response name, Success.

Before

json
{
  "swagger": "2.0",
  "info": {
    "title": "Simple API Overview",
    "version": "1.0.0"
  },
  "paths": {
    "/": {
      "get": {
        "operationId": "listVersionsv2",
        "summary": "List API versions",
        "responses": {
          "200": {
            "$ref": "#/responses/Succes"
          }
        }
      }
    }
  },
  "responses": {
    "Success": {
      "description": "A user",
      "schema": {
        "$ref": "#/definitions/User"
      }
    }
  },
  "definitions": {
    "User": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        }
      }
    }
  }
}

After

json
{
  "swagger": "2.0",
  "info": {
    "title": "Simple API Overview",
    "version": "1.0.0"
  },
  "paths": {
    "/": {
      "get": {
        "operationId": "listVersionsv2",
        "summary": "List API versions",
        "responses": {
          "200": {
            "$ref": "#/responses/Success"
          }
        }
      }
    }
  },
  "responses": {
    "Success": {
      "description": "A user",
      "schema": {
        "$ref": "#/definitions/User"
      }
    }
  },
  "definitions": {
    "User": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        }
      }
    }
  }
}

References