首页 > 解决方案 > 列出文档部分 AWS apigateway

问题描述

通过Terraform我创建了一个AWS apigateway基于文件的swagger文件。

在那个swagger文件中,我添加了特定的 AWS 端点来记录 API,例如:

"x-amazon-apigateway-documentation": {
"documentationParts": [
  {
    "location": {
      "type": "API"
    },
    "properties": {
      "description": "This is the API description"
    }
  },
  {
    "location": {
      "type": "METHOD",
      "method": "GET",
      "path": "/foo/{bar}"
    },
    "properties": {
      "description": "This is the method description"
    }
  }
]
}

然后我发布了文档版本 1.0,AWS console并尝试通过 HTTP 获取该文档,如下所述:

列出文档部分

但是,不幸的是,我做不到。我正在对端点进行 GET

http://apigateway.eu-central1.amazonaws.com/restapis/<TheIdOfMyApiGateway>/documentation/parts

它甚至没有给我一个 4XX 代码,但根本没有响应或 HTTP 代码。

我做错了什么?

标签: amazon-web-servicesswaggeraws-api-gateway

解决方案


我的不好是该地区的一个错字。我错过了一个破折号,正确的端点是:

http://apigateway.eu-central-1.amazonaws.com/restapis/<TheIdOfMyApiGateway>/documentation/parts

eu-central-1代替 eu-central1

我检查AWS 区域中的区域命名


推荐阅读