설명
#/responses/...의 이름은 최상위 responses에 정의한 응답 이름과 대소문자까지 일치해야 합니다.
잠재적 영향
참조가 끊기면 생성된 문서나 클라이언트에 해당 상태 코드의 응답 정보가 빠지거나 생성이 실패할 수 있습니다.
해결 방법
응답 이름의 철자를 확인하세요. 정의 이름을 바꾸거나 정의를 삭제할 때는 참조하는 작업도 함께 수정하세요.
예시
GET /의 200 응답에서 Succes를 Success로 고치면 응답 설명과 User 본문 스키마를 찾을 수 있습니다.
변경 전
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"
}
}
}
}
}
변경 후
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"
}
}
}
}
}