New*_*_TT 6 aws-lambda serverless
我正在尝试部署我的无服务器应用程序。但是有如下问题。
An error occurred: ApiGatewayResourceServicesServiceidVar - A sibling ({id}) of this resource already has a variable path part -- only one is allowed
Run Code Online (Sandbox Code Playgroud)
下面是我的代码。
updateApplication:
handler: handler.updateApplication
memorySize: 3008
description: Update application
timeout: 30
events:
- http:
path: services/{serviceId}/applications/{applicationId}
method: post
cors: true
authorizer: authorize
request:
parameters:
paths:
serviceId: true
applicationId: true
Run Code Online (Sandbox Code Playgroud)
任何意见或建议将不胜感激。先感谢您。
无服务器框架似乎抱怨您已定义路径参数两次。由于您已经在下面直接声明了它,因此-http:您可以删除该request: parameters: paths:块。
换句话说,试试这个:
updateApplication:
handler: handler.updateApplication
memorySize: 3008
description: Update application
timeout: 30
events:
- http:
path: services/{serviceId}/applications/{applicationId}
method: post
cors: true
authorizer: authorize
Run Code Online (Sandbox Code Playgroud)
快乐编码!
| 归档时间: |
|
| 查看次数: |
4221 次 |
| 最近记录: |