tamasfe / aide

An API documentation library
Apache License 2.0
417 stars 70 forks source link

Merging routers containing routes with the same path but different methods #51

Closed svix-andor closed 1 year ago

svix-andor commented 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

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.

Wicpar commented 1 year ago

Just made a PR with a fix :)

Wicpar commented 1 year ago

fix merged in master