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

about the : in path param #1805

Closed
BiuXWT opened this issue Mar 21, 2024 · 4 comments
Closed

about the : in path param #1805

BiuXWT opened this issue Mar 21, 2024 · 4 comments
Labels

Comments

@BiuXWT
Copy link

BiuXWT commented Mar 21, 2024

A url like this

/usr/:name/number/:id/do:work

the :work is not a param , the whole do:work string is a phrase ,
but now , the framework will consider work as a param,could you please fix it

@yhirose yhirose added the bug label Aug 30, 2024
@yhirose
Copy link
Owner

yhirose commented Aug 30, 2024

@BiuXWT thanks for the report!

@yhirose
Copy link
Owner

yhirose commented Sep 3, 2024

@bgs99 do you have any thoughts on this issue?

@bgs99
Copy link
Contributor

bgs99 commented Sep 4, 2024

@bgs99 do you have any thoughts on this issue?

I guess we could limit path parameters capture to whole path segments, so /:param would be a capture, but /not:param would be a literal segment with : in the middle.

It might break code for the users that already depend on capturing segment parts. But on the other hand, it seems that path parameter capture on segment parts is neither fully supported nor documented: it uses /: to select between named params capture and regex capture and only full segment capture is shown as examples in the docs.

Alternatively, if we want maximum flexibility, it should be possible to provide some kind of escaping mechanism, like writing /not\:param to mean /not:param literal.

@yhirose
Copy link
Owner

yhirose commented Sep 4, 2024

@bgs99 I like "limit path parameters capture to whole path segments". Could you take care of it and make a pull request, since I don't know much about the PathParamsMatcher code. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants