仅供参考 - 我已经检查了与此相关的类似问题,但没有一个能解决我的问题 .

我正在尝试为AWS Api-Gateway下的许多API创建Swagger定义 . 我能够从我从API Stage下载的自动生成的YAML配置中成功地为其他(POST,GET) endpoints 执行此操作 .

但是当我尝试使用Lambda代理集成为Api-Gateway endpoints 执行相同操作时遇到了问题:Error from Swagger editor.swagger.io

以下是我对失败 endpoints 的YAML定义:

swagger: "2.0"
    info:
      version: "2018-04-18T17-09-07Z"
      title: "XXX API"
    host: "api.xxx.io"
    schemes:
    - "https"
    parameters:
      stage:
        name: stage
        in: path
        type: string
        enum: [ staging, production]    
        required: true
    paths:
      /env/{stage}/{proxy+}:
        x-amazon-apigateway-any-method:
          produces:
            - "application/json"
          parameters:
            - $ref: '#/parameters/stage'
            - name: "proxy"
              in: "path"
              required: true
              type: "string"
          responses: {}
          x-amazon-apigateway-integration:
            uri: "arn:aws:apigateway:eu-central-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-central-1:xxxxxxxxx:function:environment/invocations"
            responses:
              default:
                statusCode: "200"
            passthroughBehavior: "when_no_match"
            httpMethod: "POST"
            cacheNamespace: "4vbcjm"
            cacheKeyParameters:
              - "method.request.path.proxy"
            contentHandling: "CONVERT_TO_TEXT"
            type: "aws_proxy"

这与AWS文档一致:enter link description here

拜托,我错过了什么?