You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently routes like /:a/:b and /:a are supported, but only if they have a common prefix (/:a). This means a route like /:a/:b conflicts with /:c. Having the user forced to change the parameter named doesn't feel very nice.
I've spent a bunch of time working on this and while its possible it also adds a bunch of extra complexity.
The solution is to normalize the params so routes like /:a/foo/:b would become /:axum_param_0/foo/:axum_param/2. So split the path on / and rename params based on their depth. You then also need to store the mapping back to the original param name so Path can access it.
Opaque nested services is also fun since you need to carry the param mapping forward via a request extension so inner routers can access it. You also need to be careful that inner routers don't use the same normalized param names as outer routers which, since inner routers are created first.
All these things are do-able but I don't feel they're worth the additional complexity. I haven't heard anyone else ask about this so I'd consider this an edge case. Ideally it should be fixed in matchit.
Currently routes like
/:a/:b
and/:a
are supported, but only if they have a common prefix (/:a
). This means a route like/:a/:b
conflicts with/:c
. Having the user forced to change the parameter named doesn't feel very nice.cc ibraheemdev/matchit#13
The text was updated successfully, but these errors were encountered: