From 0f22c353bf10c6eed8efc2210c6d43cfda5ae174 Mon Sep 17 00:00:00 2001 From: Spencer Ferris <3319370+spencewenski@users.noreply.github.com> Date: Sun, 7 Jul 2024 12:37:25 -0700 Subject: [PATCH] fix: Correctly add the `ApiRouter` to the HTTP service's `ApiRouter` (#273) The `HttpServiceBuilder#api_router` method is incorrectly adding the provided `ApiRouter` to the normal axum `Router`. This means the routes defined in the provided `ApiRouter` will not show up in the generated OpenAPI schema. Fix the method to correctly merge the provided `ApiRouter` with the `HttpServiceBuilder`'s `ApiRouter`. --- src/service/http/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service/http/builder.rs b/src/service/http/builder.rs index f0bf5d7c..4e8a6bb3 100644 --- a/src/service/http/builder.rs +++ b/src/service/http/builder.rs @@ -104,7 +104,7 @@ where #[cfg(feature = "open-api")] pub fn api_router(mut self, router: ApiRouter) -> Self { - self.router = self.router.merge(router); + self.api_router = self.api_router.merge(router); self }