작업별 외부 문서 URL 점검

작업의 상세 가이드가 올바른 링크로 연결되는지 확인하세요.

설명

작업의 externalDocs.url에는 해당 호출의 사용법을 연결하세요.

잠재적 영향

다른 작업의 안내로 연결되면 입력값이나 호출 순서를 잘못 적용할 수 있습니다.

해결 방법

렌더링된 문서의 해당 작업에서 링크를 열어 보세요. 상대 URL이라면 문서 도구가 어느 호스트와 경로를 선택하는지 확인하세요. 다른 사이트의 가이드에는 전체 URL을 사용하세요.

예시

예시의 작업은 listVersionsv2입니다. 샘플 주문 페이지 대신 버전 목록 조회에 맞는 가이드를 지정하세요.

변경 전

json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Simple API Overview",
    "version": "1.0.0",
    "contact": {
      "name": "contact",
      "url": "https://www.google.com/",
      "email": "user@gmail.com"
    }
  },
  "paths": {
    "/": {
      "get": {
        "operationId": "listVersionsv2",
        "summary": "List API versions",
        "externalDocs": {
          "url": "/"
        },
        "responses": {
          "200": {
            "description": "200 response",
            "content": {
              "application/json": {
                "examples": {
                  "foo": {
                    "value": {
                      "versions": [
                        {
                          "status": "CURRENT",
                          "updated": "2011-01-21T11:33:21Z",
                          "id": "v2.0",
                          "links": [
                            {
                              "href": "http://127.0.0.1:8774/v2/",
                              "rel": "self"
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

변경 후

json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Simple API Overview",
    "version": "1.0.0",
    "contact": {
      "name": "contact",
      "url": "https://www.google.com/",
      "email": "user@gmail.com"
    }
  },
  "paths": {
    "/": {
      "get": {
        "operationId": "listVersionsv2",
        "summary": "List API versions",
        "externalDocs": {
          "url": "http://docs.my-api.com/store-orders.htm"
        },
        "responses": {
          "200": {
            "description": "200 response",
            "content": {
              "application/json": {
                "examples": {
                  "foo": {
                    "value": {
                      "versions": [
                        {
                          "status": "CURRENT",
                          "updated": "2011-01-21T11:33:21Z",
                          "id": "v2.0",
                          "links": [
                            {
                              "href": "http://127.0.0.1:8774/v2/",
                              "rel": "self"
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

참조