Closed svix-andor closed 1 year ago
If I'm reading the code correctly, then if you merge two routers, each with a route that is on the same path but listening for a different method then the second one will overwrite the specification in paths. I'm talking about the following: https://github.com/tamasfe/aide/blob/dcac37586ce753abf071548345777510b694d154/crates/aide/src/axum/mod.rs#L489-L502
paths
Specifically, instead of paths.extend(other.paths), the entry should be retrieved and merging should be done on the method level, so that two routers with overlapping paths but nonoverlapping methods can be merged correctly.
paths.extend(other.paths)
Just made a PR with a fix :)
fix merged in master
If I'm reading the code correctly, then if you merge two routers, each with a route that is on the same path but listening for a different method then the second one will overwrite the specification in
paths
. I'm talking about the following: https://github.com/tamasfe/aide/blob/dcac37586ce753abf071548345777510b694d154/crates/aide/src/axum/mod.rs#L489-L502Specifically, instead of
paths.extend(other.paths)
, the entry should be retrieved and merging should be done on the method level, so that two routers with overlapping paths but nonoverlapping methods can be merged correctly.