diff --git a/utoipa-axum/src/router.rs b/utoipa-axum/src/router.rs index ad3a5069..b30342dd 100644 --- a/utoipa-axum/src/router.rs +++ b/utoipa-axum/src/router.rs @@ -253,8 +253,15 @@ where }) }; - // add current paths to the OpenApi - self.1.paths.paths.extend(paths.paths.clone()); + // add or merge current paths to the OpenApi + for (path, item) in paths.paths.clone() { + if let Some(it) = self.1.paths.paths.get_mut(&path) { + it.merge_operations(item); + } else { + self.1.paths.paths.insert(path, item); + } + } + let components = self .1 .components