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
Allow multiple segment converters to have tailing segments #2061
Comments
One unambiguous way slightly extending your prototype could be still supporting only one field of type |
I personally think this should be a follow on PR, since it's not trivial to support a case like your example |
Yes, absolutely, I meant splitting or simplifying this issue, not by further complicating #1945. |
Oh ok, I misunderstood. I don't feel supporting two or more multiple segment converter is that much harder than supporting tailing segments. Still I agree with you that we could go one step at the time, and have fist a version that does not support multiple multi-segment converters |
copying from the PR:
|
The issue with shouldn't match is that |
|
note that this is the current behaviour: |
Aha, it does... that's maybe oversight too, we do disallow a double slash in the templates at least, but maybe not when matching... Well, in either case we should follow the current behaviour, and IMHO |
I guess that in that sense we should keep this behavior, so the code above would not work. We probably need to check that |
yes, replacing |
I tend to agree, considering it's the current behaviour of the framework and changing that would entail quite a bit more work, since it's not easy to communicate. It may be unfortunate that Should we document it? |
The initial version of the converters that support matching multiple paths added in #1945 prevents adding additional segments after the path, meaning that something like
/foo/{x:path}/bar
is not supported.Adding support to it is not trivial. A prototype find would be something like this:
(edit: see reply #2061 (comment) regarding how to prevent empty matches)
running the above yields
A decision to take would be what to do regarding supporting multiple "consume multiple segments" in a single url.
Like what would
/foo/{bar:path}/{baz:path}
match in case of/foo/bar/baz
?I think the issue would be there also if they two converter are separated by a literal segment or normal converted, since this template
/foo/{bar:path}/x/{baz:path}
would still be ambiguous for a route like/foo/bar/x/y/x/other/part
ref: #1945 (comment)
The text was updated successfully, but these errors were encountered: