Description
The name in #/responses/... must match a top-level responses entry, including case.
Potential impact
A broken reference can leave a status code undocumented or stop client generation.
Remediation
Check the spelling of the response name. When renaming or removing a definition, update the operations that reference it.
Examples
Changing Succes to Success gives the 200 response for GET / its description and User body schema.
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"
}
}
}
}
}