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

Verify that for each path each cowboy binding has a correspondingly named parameter #98

Open
lucafavatella opened this issue Mar 9, 2017 · 3 comments

Comments

@lucafavatella
Copy link
Contributor

E.g. a cowboy binding :id must have a corresponding Swagger parameter named id.

Current behaviour is that such constraint is not enforced hence cowboy_swagger generates /api-docs/swagger.json for UI accessible at /api-docs with path that may contain bindings with no corresponding parameter, hence causing curly variable template to be sent to server.


Example: trail with cowboy binding called :id and swagger parameter named key causes this Swagger UI...

swaggeruiwithkeyratherthanid

... that when clicking Try it out! sends to server something like /places/{id} - i.e. with no replaced value:

2017-03-09 13:15:16.503 [info] <0.942.0> PUT /places/%7Bid%7D
@paulo-ferraz-oliveira
Copy link
Collaborator

Tentatively assigning this to myself. Can't guarantee I'll look at it in the near future, but this way it'll be on my "radar".

@paulo-ferraz-oliveira paulo-ferraz-oliveira self-assigned this Oct 28, 2020
@paulo-ferraz-oliveira
Copy link
Collaborator

I bumped into this today. I want to have a route like /users/:user_id/[queries/:query_id] where the optional part is not acceptable for a PUT operation. The way it is the request is getting sent as /users/<user_id>/queries/{query_id}, since I have no input to fill in.

@paulo-ferraz-oliveira
Copy link
Collaborator

I bumped into this today. I want to have a route like /users/:user_id/[queries/:query_id] where the optional part is not acceptable for a PUT operation. The way it is the request is getting sent as /users/<user_id>/queries/{query_id}, since I have no input to fill in.

Hm... probably not the same issue, since I can have different trails for different routes. Oh, well...

@paulo-ferraz-oliveira paulo-ferraz-oliveira removed their assignment Mar 11, 2023
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

2 participants