Amazon web services &引用;无法分析HTTP响应内容";创建ApiGateway::Resource时

Amazon web services &引用;无法分析HTTP响应内容";创建ApiGateway::Resource时,amazon-web-services,aws-lambda,amazon-cloudformation,Amazon Web Services,Aws Lambda,Amazon Cloudformation,当我尝试使用AWS CloudFormation创建API网关->GET方法并集成到Lambda函数时,我遇到了错误:create\u失败的AWS::ApiGateway::Resource[我的资源]无法解析HTTP响应内容 有什么想法吗 指定MethodResponses时,必须包含状态代码 这将以“无法解析”失败: 这将成功: "MethodResponses": [{ "ResponseModels": { "application/json": { "Ref": "myMo

当我尝试使用AWS CloudFormation创建API网关->
GET
方法并集成到Lambda函数时,我遇到了错误:
create\u失败的AWS::ApiGateway::Resource[我的资源]无法解析HTTP响应内容


有什么想法吗

指定MethodResponses时,必须包含状态代码

这将以“无法解析”失败:

这将成功:

"MethodResponses": [{
  "ResponseModels": {
    "application/json": { "Ref": "myModel" }
  },
  "StatusCode": 200 
} ],

不,不是这样说的。它也没有给出一个例子。

我曾经面对过这个问题,发现CloudFormation Designer最终似乎有一个怪癖,它一直在删除我资源的parentId

在上载之前检查云形成模板,并确认ParentId仍在资源定义中


“myApiResource”:{
“类型”:“AWS::ApiGateway::Resource”,
“财产”:{
“RestApiId”:{
“参考”:“myRestApi”
},
“路径部分”:“我的路径”,
“家长ID”:{
“Fn::GetAtt”:[
“myRestApi”,
“RootResourceId”
]
}
},

谢谢!这并没有解决我的问题,所以我在swagger文件中描述了我的API网关,现在一切正常。谢谢!看起来你是对的,CloudFormation designer从我的资源中删除了parentId,我再次添加了它,现在它开始工作了。
"MethodResponses": [{
  "ResponseModels": {
    "application/json": { "Ref": "myModel" }
  },
  "StatusCode": 200 
} ],