-
SummaryHello, I'd like to define a router that supports a variadic number of path components up to a specific delimiter ( This looks exceptionally hard to do in axum since path components are not consumed by parent routers. So even with a custom serde implementation of a sequence visitor for the path extractor, that stops when it encounters the Is there any way to work around this? axum version0.7.7 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Do you mean this feature? Until matchit supports it, axum cannot use variadic path components that are not at the end of the route. I'm honestly not sure what you meant by components not being consumed by parent routers. Could you please provide an example of what you tried, what you expected and what happened? |
Beta Was this translation helpful? Give feedback.
-
So what I ended up doing is foul, but I literally have no other easy choice at the moment if I don't want to reimplement the router completely. I have a top-level middleware (outside of the router) that tries to find the very specific vararg routes that cause me trouble, and rewrites them to constant routes that the router will handle, while simultaneously injecting the dynamic path parts as extensions. |
Beta Was this translation helpful? Give feedback.
Do you mean this feature? Until matchit supports it, axum cannot use variadic path components that are not at the end of the route.
I'm honestly not sure what you meant by components not being consumed by parent routers. Could you please provide an example of what you tried, what you expected and what happened?