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
I have looked for existing issues (including closed) about this
Bug Report
Version
axum v0.6.20
├── axum-core v0.3.4
Platform
Linux zirconium 6.4.12-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Thu, 24 Aug 2023 00:37:46 +0000 x86_64 GNU/Linux
Description
Cannot have 2 routes with different parameters and different methods, as I receive an error stating there is a conflict
I tried this code:
use axum::{
routing::{post, put},Router,Server,};#[tokio::main]asyncfnmain(){Server::bind(&"0.0.0.0:8000".parse().unwrap()).serve(Router::new().route("/:name",post(|| async{})).route("/:id/:name",put(|| async{})).into_make_service(),).await.unwrap();}
I expected to see no error, however, I got this: Invalid route "/:id/:name": insertion failed due to conflict with previously registered route: /:name
This is just a reproducer as in a real service, I use Path(id): Path<i64> and Path(name): Path<String>, however, it still gives me the same error. Is this some kind of bug?
I looked at the MethodRouter and the issue that motivated its implementation, however MethodRouter doesn't seem to be the correct approach here, but correct me if I am misunderstood
The text was updated successfully, but these errors were encountered:
Since it's a bug in one of axum's dependencies there isn't anything we can do about it. Though its hopefully going to be fixed in the next major version of axum (which will include the next major of matchit)
Bug Report
Version
Platform
Linux zirconium 6.4.12-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Thu, 24 Aug 2023 00:37:46 +0000 x86_64 GNU/Linux
Description
Cannot have 2 routes with different parameters and different methods, as I receive an error stating there is a conflict
I tried this code:
I expected to see no error, however, I got this:
Invalid route "/:id/:name": insertion failed due to conflict with previously registered route: /:name
This is just a reproducer as in a real service, I use
Path(id): Path<i64>
andPath(name): Path<String>
, however, it still gives me the same error. Is this some kind of bug?I looked at the MethodRouter and the issue that motivated its implementation, however MethodRouter doesn't seem to be the correct approach here, but correct me if I am misunderstood
The text was updated successfully, but these errors were encountered: