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

Handler parameters parsed from URL should be url-decoded #73

Open
PetrGlad opened this issue Mar 1, 2017 · 2 comments
Open

Handler parameters parsed from URL should be url-decoded #73

PetrGlad opened this issue Mar 1, 2017 · 2 comments

Comments

@PetrGlad
Copy link
Contributor

PetrGlad commented Mar 1, 2017

It seems that path parameters (ones that have property "in: path") are passed to handler function as is.
This causes a problem since handler should now process values these parameters differently depending on how they are passed to API.

So parameters that are passed via path should be url-decoded before passing them to handler.
Example:
With API declared as

"/somepath/{parameter_name}":
  get:
     parameters:
        - name: parameter-name
          in: path 
          type: string

and actual call curl "localhost:8080/somepath/abc%3D%3D"
the handler function should get parameter map {:parameter_name "abc=="}

Used swagger1st implementation passes instead parameter map as {:parameter_name "abc%3D%3D"}

Version used 0.22.0-beta2

I admit that this is backwards-incompatible change but the right one.

@sebastianpoeplau
Copy link
Contributor

I agree that it would be a useful change. How about making the behavior configurable? Then people who are aware of the issue could enable the "right" behavior while existing projects still get the old logic by default.

@PetrGlad
Copy link
Contributor Author

PetrGlad commented Mar 2, 2017

There are other cleanups (e.g. excluding non-core functionality and stricter validations) that could also be made. So I would vote for some new major incompatible version.

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