6

I'm trying to deploy my serverless app. But have a problem like below.

An error occurred: ApiGatewayResourceServicesServiceidVar - A sibling ({id}) of this resource already has a variable path part -- only one is allowed  

And below is my code.

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

Any advice or suggestion would be appreciated. Thank you in advance.

2
  • 1
    check this out github.com/serverless/serverless/issues/3785 - Looks like a problem with the CF is generate via serverless. Commented Nov 18, 2018 at 19:53
  • Thanks @MrkFldig Commented Dec 5, 2018 at 9:21

1 Answer 1

2

The serverless framework seems to be complaining that you have defined the path parameters twice. Since you have declared it there directly below -http: you can remove the request: parameters: paths: block.

In other words, try this:

updateApplication:
    handler: handler.updateApplication
    memorySize: 3008
    description: Update application
    timeout: 30
    events:
      - http:
          path: services/{serviceId}/applications/{applicationId}
          method: post
          cors: true
          authorizer: authorize

Happy coding! 👍

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.