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

Parameters in path with - mark the path as invalid #70

Open
CorruptedHeart opened this issue Mar 10, 2022 · 2 comments
Open

Parameters in path with - mark the path as invalid #70

CorruptedHeart opened this issue Mar 10, 2022 · 2 comments
Labels
support Questions, discussions, and general support

Comments

@CorruptedHeart
Copy link

Support plan

  • is this issue currently blocking your project? (yes/no): Sort of
  • is this issue affecting a production system? (yes/no): No

Context

  • node version: 14
  • module version with issue: call
  • last module version without issue: -
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): Serverless offline
  • any other relevant information:

What are you trying to achieve or the steps to reproduce?

We have an endpoint in a serverless.yml file specified as follows:

      - http:
          path: /features/{entity-id}
          method: post

Serverless offline uses Hapi to generate a local server that allows offline testing of a Serverless application.

Unfortunately we are unable to change the parameter to a _ separated one or camelCase because when deploying the Serverless application it complains because the same path already exists.

What was the result you got?

Error: Invalid path: /dev/features/{entity-id}

What result did you expect?

Not having an error with the path.

@CorruptedHeart CorruptedHeart added the support Questions, discussions, and general support label Mar 10, 2022
@Marsup
Copy link
Contributor

Marsup commented Mar 10, 2022

This will be hard without a mean to reproduce your problem. This is a documented constraint here, why would replacing the dash with an underscore cause a path conflict?

@CorruptedHeart
Copy link
Author

I can put together a sample project later today.

I did not know that that constraint was in place.

The main problem with the path conflict is a Serverless/Cloudformation deploy issue. I am assuming it pulls out all parameters ({}) as positionals or it normalises them. And won't allow the deploy to occur, since a path already exists in cloudformation with params in the same positions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions, discussions, and general support
Projects
None yet
Development

No branches or pull requests

2 participants