我正在尝试部署无服务器应用程序。 但是有如下问题。
An error occurred: ApiGatewayResourceServicesServiceidVar - A sibling ({id}) of this resource already has a variable path part -- only one is allowed
下面是我的代码。
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
任何建议或建议将不胜感激。预先谢谢你。
答案 0 :(得分:2)
无服务器框架似乎在抱怨您两次定义了路径参数。由于您已经在-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
祝您编程愉快! ?