MENU
      Canary Swagger Jsonの照会

        Canary Swagger Jsonの照会


        記事の要約

        Classic/VPC環境で利用できます。

        Canaryに公開された API文書内容を Swagger JSON形式で照会します。

        リクエスト

        リクエスト形式を説明します。リクエスト形式は次の通りです。

        メソッドURI
        GET/products/{product-id}/apis/{api-id}/stages/{stage-id}/canary/swagger-json

        リクエストヘッダ

        API Gatewayで共通して使用されるヘッダの詳細は、API Gatewayのリクエストヘッダをご参照ください。

        リクエストパスパラメータ

        パラメータの説明は次の通りです。

        フィールドタイプ必須の有無説明
        product-idStringRequiredAPIと関連付けられた Product ID
        • 1~10文字
        api-idStringRequiredProductに作成された API ID
        • 1~10文字
        stage-idStringRequiredAPIに作成された Stage ID
        • 1~10文字

        リクエスト例

        リクエストのサンプルコードは次の通りです。

        curl -X GET 'https://apigateway.apigw.ntruss.com/api/v1/products/{product-id}/apis/{api-id}/stages/{stage-id}/canary/swagger-json' \
        --header 'Content-Type: application/json' \
        --header 'x-ncp-apigw-timestamp: {Timestamp}' \
        --header 'x-ncp-iam-access-key: {Access Key}' \
        --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'
        Curl

        レスポンス

        レスポンス形式を説明します。

        レスポンス構文

        構文は次の通りです。

        {
        "documentJson": "documentJson"
        }
        JSON

        レスポンスステータスコード

        API Gatewayで共通して使用されるレスポンスステータスコードの詳細は、API Gatewayのレスポンスステータスコードをご参照ください。

        レスポンス例

        レスポンスのサンプルコードは次の通りです。

        {
        "documentJson": "{"swagger" : "2.0",
          "info" : {
            "description" : "api Description<br/>https://**********.apigw.ntruss.com/api/v1",
            "version" : "2024-05-08T08:17:35Z",
            "title" : "api-***"
          },
          "host" : "**********.apigw.ntruss.com",
          "basePath" : "/***/***",
          "schemes" : [ "https" ],
          "paths" : {
            "/" : { },
            "/***" : {
              "post" : {
                "tags" : [ "v1" ],
                "parameters" : [ {
                  "name" : "****",
                  "in" : "query",
                  "description" : "",
                  "required" : false,
                  "type" : "string",
                  "x-ncp-parameter-is-logged" : false
                } ],
                "security" : [ {
                  "x-ncp-iam" : [ ]
                } ],
                "responses" : {
                  "200" : {
                    "description" : "default"
                  }
                },
                "x-ncp-apigw-use-body-when-formdata" : false,
                "x-ncp-apigateway-filters" : {
                  "valid" : {
                    "type" : "NONE"
                  },
                  "apiKey" : {
                    "required" : true
                  },
                  "auth" : {
                    "platform" : "IAM"
                  }
                }
              }
            }
          },
          "securityDefinitions" : {
            "x-ncp-iam" : {
              "type" : "apiKey",
              "name" : "x-ncp-iam",
              "in" : "header",
              "x-ncp-apigw-auth-ver" : "v2"
            },
            "x-ncp-apigw-api-key" : {
              "type" : "apiKey",
              "name" : "x-ncp-apigw-api-key",
              "in" : "header"
            }
          }
        }"
        }
        JSON

        この記事は役に立ちましたか?

        Changing your password will log you out immediately. Use the new password to log back in.
        First name must have atleast 2 characters. Numbers and special characters are not allowed.
        Last name must have atleast 1 characters. Numbers and special characters are not allowed.
        Enter a valid email
        Enter a valid password
        Your profile has been successfully updated.