-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
request help: Parameters in path #2058
request help: Parameters in path #2058
Comments
we may fix this bug in |
@membphis Looks like the second issue (about the asterisk "*" syntax, denoting an optional parameter I believe) is not addressed in radixtree 2.2; could you re-open the issue? |
I created a new issue at one issue for one bug, it is easier to fix. |
Issue description
https://github.com/gin-gonic/gin#parameters-in-path described a ":" syntax and an "*" syntax for parameters in path, I believe radixtree (and therefore APISIX) intended to support both.
For the ":" syntax, currently APISIX seems to accept ANY string. For example, request "/a/b/c/foo" seems to be accepted by "uri": "/:id/foo". I'm not sure if that's the expected behavior: matching ":id" with non-slash character sounds more natural to me (something like "[^/]+").
For the "*" syntax, my understanding is that "*action" is an optional parameter. For example if we configure "uri": "/:id/foo/*action/bar" in APISIX, both requests "/1/foo/get/bar" and "/2/foo/bar" should be matched by the route, while request "/3/foo/a/b/bar" should be rejected. However in APISIX the "*" syntax has similar behavior with the colon syntax. The tests 7, 8 here https://github.com/api7/lua-resty-radixtree/blob/master/t/parameter.t seems broken: they are named "/name/*name/foo" but tested with "/name/:name/foo"
Environment
apisix version
): 1.5, with radixtree 2.1The text was updated successfully, but these errors were encountered: