-
Couldn't load subscription status.
- Fork 304
Open
Description
I have two endpoints where each of them in the own module, and they have equal names, so we need to join them by nest:
mod first {
use utoipa::OpenApi;
#[derive(OpenApi)]
#[openapi(paths(get))]
pub struct Doc;
#[utoipa::path(get, path = "")]
pub async fn get() -> &'static str {
"First"
}
}
mod second {
use utoipa::OpenApi;
#[derive(OpenApi)]
#[openapi(paths(get))]
pub struct Doc;
#[utoipa::path(get, path = "")]
pub async fn get() -> &'static str {
"Second"
}
}
#[derive(OpenApi)]
#[openapi(
nest(
(path = "/second", api = second::Doc),
(path = "/first", api = first::Doc),
),
)]
pub struct ApiDoc;I open /swagger endpoint and use /second, but it calls /first, what is incorrect, so I tried to do so with RapiDoc and it doesn't have the problem.
I created an example to demonstrate that correct utoipa usage with axum leads to incorrect UI in Swagger.
Cheban1996
Metadata
Metadata
Assignees
Labels
No labels