-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Undocumented breaking change in routing in axum 0.6 #1669
Comments
I think this should actually work because |
Doesn't look like it's pub fn main() -> anyhow::Result<()> {
let mut router = Router::new();
router.insert("/home/:param", "a")?;
router.insert("/home/:param/*nest", "b")?;
Ok(())
} (or maybe I'm testing it incorrectly) |
Aha, so apparently we (intentionally) register three
So |
… which means:
|
This doesn't work if the conflict is at the root. Example let router = Router::new()
.route("/", get(handler))
.nest("/", Router::new()); |
But yeah we should add that to the changelog. @j-tai You probably wanna use |
Thanks. I actually ended up using |
This is the reproducer for my comment. Finally found the time.
Bug Report
Version
axum v0.6.1
axum-core v0.3.0
Platform
Linux hostname 6.1.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 21 Dec 2022 22:27:55 +0000 x86_64 GNU/Linux
Description
Starting a server with the following router works with
axum 0.5
but fails withthread 'main' panicked at 'Invalid route "/path/:parameter": insertion failed due to conflict with previously registered route: /path/:parameter/*__private__axum_nest_tail_param'
onaxum 0.6
.If this is an intentional breaking change, it would be helpful to document this in the Changelog
The text was updated successfully, but these errors were encountered: