OpenAPI 속성 이름과 위치 점검

각 객체에서 허용하는 속성 이름과 위치를 확인하세요.

설명

OpenAPI 3.0의 표준 필드는 해당 객체가 정의한 위치와 철자, 대소문자를 따르세요. 데이터 필드 이름은 API 모델에 맞춰 정합니다.

잠재적 영향

응답의 필수 설명을 잘못 적으면 검증에 실패하고 태그 설명은 생성된 문서에서 빠질 수 있습니다.

해결 방법

사용자 정의 메타데이터에는 확장을 허용하는 객체에서 x-를 쓰고 사용하는 도구가 이를 읽는지 확인하세요. 수정 후 검증기와 생성된 문서에서 응답·태그 설명을 확인하세요.

예시

예시는 참조한 보안 스킴 exampleSecurity의 정의를 생략합니다. 전체 문서를 검증할 때는 그 정의도 포함하세요.

변경 전

json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Simple API Overview",
    "version": "1.0.0"
  },
  "paths": {
    "/": {
      "get": {
        "operationId": "listVersionsv2",
        "summary": "List API versions",
        "responses": {
          "200": {
            "descrinnption": "200 response"
          }
        }
      }
    }
  },
  "security": [
    {
      "exampleSecurity": []
    }
  ],
  "tags": [
    {
      "name": "pets",
      "desdddcription": "Everything about your Pets",
      "externalDocs": {
        "url": "http://docs.my-api.com/pet-operations.htm"
      }
    },
    {
      "name": "store",
      "description": "Access to Petstore orders",
      "externalDocs": {
        "url": "http://docs.my-api.com/store-orders.htm"
      }
    }
  ]
}

변경 후

json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Simple API Overview",
    "version": "1.0.0"
  },
  "paths": {
    "/": {
      "get": {
        "operationId": "listVersionsv2",
        "summary": "List API versions",
        "responses": {
          "200": {
            "description": "200 response"
          }
        }
      }
    }
  },
  "security": [
    {
      "exampleSecurity": []
    }
  ],
  "tags": [
    {
      "name": "pets",
      "description": "Everything about your Pets",
      "externalDocs": {
        "url": "http://docs.my-api.com/pet-operations.htm"
      }
    },
    {
      "name": "store",
      "description": "Access to Petstore orders",
      "externalDocs": {
        "url": "http://docs.my-api.com/store-orders.htm"
      }
    }
  ]
}

200 응답의 descrinnption과 pets 태그의 desdddcription을 description으로 고칩니다. 두 예시 모두 응답 본문을 정의하지 않습니다.

참조