Replies: 1 comment 1 reply
-
|
I think the main / only reason nested fallbacks aren't supported is that matchit doesn't support having both a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed that, at least after #408, Axum doesn't allow having a
.nestrouter that has a fallback (well as of 0.3.4 it's possible to add, but it never gets routed to-- because of #488 / #529 this looks like it will become a panic soon).We have a use case where having a nested fallback is useful, specifically we have a structure like this:
/v1/swagger/schema.json→ Return fixed responseStaticDirSo, if
.nest()could take aRouterwith a.fallback(), then we could easily model the above. Without it, it would start to get messy. For now, we came up with the following simple workaround: usingservice_method_routing::anyto wrap theRouter. Here's what it looks like in code:(Here's a full working example: https://github.com/kylewlacy/test-axum-nested-routing)
So there's the context basically. For purposes of discussion, here are 2 questions to start:
service_method_routing::anyto wrap a router intended? That is, can we rely on the above behavior indefinitely?Beta Was this translation helpful? Give feedback.
All reactions