Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create resource at path #629

Open
jarakkal opened this issue Jun 28, 2018 · 2 comments
Open

Unable to create resource at path #629

jarakkal opened this issue Jun 28, 2018 · 2 comments

Comments

@jarakkal
Copy link

jarakkal commented Jun 28, 2018

https://github.com/serverless/blog/blob/master/posts/2018-05-07-how-create-rest-api-serverless-components.md

I am following the above post, getting an error when running 'components deploy'

BadRequestException: Errors found during import: Unable to create resource at path '/\leads': Resource's path part only allow a-zA-Z0-9._- and curly braces at the beginning and the end. Unable to create resource at path '/\leads\{id}': Resource's path part only allow a-zA-Z0-9._- and curly braces at the beginning and the end. at Object.extractError (C:\Users\jento\AppData\Roaming\npm\node_modules\serverless-components\registry\aws-apigateway\node_modules\aws-sdk\lib\protocol\json.js:48:27) at Request.extractError (C:\Users\jento\AppData\Roaming\npm\node_modules\serverless-components\registry\aws-apigateway\node_modules\aws-sdk\lib\protocol\rest_json.js:52:8) at Request.callListeners (C:\Users\jento\AppData\Roaming\npm\node_modules\serverless-components\registry\aws-apigateway\node_modules\aws-sdk\lib\sequential_executor.js:105:20) at Request.emit (C:\Users\jento\AppData\Roaming\npm\node_modules\serverless-components\registry\aws-apigateway\node_modules\aws-sdk\lib\sequential_executor.js:77:10) at Request.emit (C:\Users\jento\AppData\Roaming\npm\node_modules\serverless-components\registry\aws-apigateway\node_modules\aws-sdk\lib\request.js:683:14) at Request.transition (C:\Users\jento\AppData\Roaming\npm\node_modules\serverless-components\registry\aws-apigateway\node_modules\aws-sdk\lib\request.js:22:10) at AcceptorStateMachine.runTo (C:\Users\jento\AppData\Roaming\npm\node_modules\serverless-components\registry\aws-apigateway\node_modules\aws-sdk\lib\state_machine.js:14:12)

I tried removing {id}, but still get the same error.

Please help. My serverless.yml

....
type: rest-api
    inputs:
      gateway: aws-apigateway
      routes:
        /leads:
          post:
            function: ${createLead}
            cors: true
          get:
            function: ${listLeads}
            cors: true
          /{id}:
            get:
              function: ${getLead}
              cors: true
....
@82949712
Copy link

82949712 commented Nov 2, 2018

same question

@pmuens
Copy link
Contributor

pmuens commented Nov 5, 2018

Hey @jarakkal and @82949712

🤔 that's interesting. Never seen such an error before. Can you try to remove the / from /leads and try again.

Are both of you running Windows as an OS?
My hunch is that there's something Windows-specific going on when the path definition is processed.

We're currently refactoring the codebase and will publish a new version of such soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants