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

Improving the regular expression used to remove gorilla.mux-style regexp in paths #45

Closed
Fifi31 opened this issue Sep 22, 2022 · 3 comments · Fixed by #46
Closed

Improving the regular expression used to remove gorilla.mux-style regexp in paths #45

Fifi31 opened this issue Sep 22, 2022 · 3 comments · Fixed by #46

Comments

@Fifi31
Copy link

Fifi31 commented Sep 22, 2022

Hello,
Imagine I have the 2 routes in my API : /users/{userID:[^/]+} and /users/{userID:[^/]+}/books/{bookID:.+}.
The regexp are [^/]+ because without it, calling users/toto/books/openapi, matches with /users/{userID:[^/]+} with userID being toto/books/openapi.

The problem is that during Spec.SetupOperation(), {userID:[^/]+} is not matched by regexFindPathParameter ({([^}:]+)(:[^/]+)?(?:})).

I think changing the regex to {([^}:]+)(:[^}]+)?(?:}) would solve the problem.

@vearutop
Copy link
Member

Thank you, please try v0.2.22.

@Fifi31
Copy link
Author

Fifi31 commented Oct 10, 2022

Thanks, I briefly tested it but it is still not working. I will dig deeper in it when I have time.

@Fifi31
Copy link
Author

Fifi31 commented Oct 24, 2022

Hey @vearutop I had the chance to look at it, and it works well. Thanks for everything !

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 a pull request may close this issue.

2 participants