-
Notifications
You must be signed in to change notification settings - Fork 122
Fix behavior when optional parameters are defined within a route and not at the end #357
Comments
After doing some further investigation the E2E behavior is expected here. The optional parameter will be ignored during route matching. And for route generation it will only be considered as a default value. So for example, given the template
It will only match routes like
and at link generation time, it will generate the route
The reason for this to happen is that while TreeRouteBuilder creates the incorrect tree, TemplateRouteMatcher actually checks all the segments in the template and fails to match requests like /a/b when it gets to the d segment and determines that its not optional. Given that the current behavior is what we expected the fix for this bug to be, we don't have to do anything here other than add the relevant tests to document the behavior here. |
I don't get what you're saying - are you saying that the behavior in 1.0.0 is correct or incorrect? |
I think this bug just needs to be closed, no? |
@rynowak still wants to fix the behavior on treeroutebuilder. |
We build the wrong data structure, and then rely on the implementation details of another part of the code to bail us out. |
Well that sounds just dandy 😄 Indeed, let's clean that up... And we're sure we have enough test coverage for this now? |
#326
We create the incorrect tree. We should remove the optionality for route matching when we create the attribute route tree.
The text was updated successfully, but these errors were encountered: