Skip to content

Commit

Permalink
fix: Correctly add the ApiRouter to the HTTP service's ApiRouter (#…
Browse files Browse the repository at this point in the history
…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`.
  • Loading branch information
spencewenski authored Jul 7, 2024
1 parent e3ce636 commit 0f22c35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/service/http/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ where

#[cfg(feature = "open-api")]
pub fn api_router(mut self, router: ApiRouter<S>) -> Self {
self.router = self.router.merge(router);
self.api_router = self.api_router.merge(router);
self
}

Expand Down

0 comments on commit 0f22c35

Please sign in to comment.