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

Validate path variables. Fixes #865 #866

Merged
merged 4 commits into from Dec 21, 2020
Merged

Validate path variables. Fixes #865 #866

merged 4 commits into from Dec 21, 2020

Conversation

aldenquimby
Copy link
Contributor

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you written unit tests?
  • Have you written unit tests that cover the negative cases (i.e.: if bad data is submitted, does the library respond properly)?
  • This PR is associated with an existing issue?

Closing issues
Closes #865

If this is a new feature submission:

  • Has the issue had a maintainer respond to the issue and clarify that the feature is something that aligns with the goals and philosophy of the project?

Potential Problems With The Approach

  • Breaking change. Would any users rely on { or } being part of their path?

Test plan

  • Unit tests show {param} -> :param replacement still works, and that errant { or } now throw

@WoH
Copy link
Collaborator

WoH commented Dec 12, 2020

Should route/swagger behave differently? Obviously not. However, I'd say that's for now mainly a bug with the square bracket conversation.
I'm don't know what each of the possibly underlying frameworks do with square brackets, I'd hope they auto escape/accept the raw and the %endoded form.

The current implementation is already too aggressively replacing things, so I'd rather not do more of that.

@aldenquimby
Copy link
Contributor Author

@WoH good point. I updated the implementation to match swagger. So instead of throwing if there are floating { or } in a path, route generation just won't replace them.

Note - I also renamed from brackets [] to braces {} because I was using the wrong term

@WoH
Copy link
Collaborator

WoH commented Dec 21, 2020

LGTM, thanks a lot.

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

Successfully merging this pull request may close these issues.

Validate that path variables are formatted correctly
2 participants