feat(router): serve OpenAPI docs at /docs (#698)

Co-authored-by: bernard eugine <bernard.eugine@bernard.eugine-MacBookPro>
Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in>
This commit is contained in:
bernard-eugine
2023-03-01 23:46:45 +05:30
committed by GitHub
parent adca6bcac3
commit ed2907e141
12 changed files with 356 additions and 489 deletions

View File

@ -78,6 +78,15 @@ pub fn mk_app(
> {
let mut server_app = get_application_builder(request_body_limit);
#[cfg(feature = "openapi")]
{
use utoipa::OpenApi;
server_app = server_app.service(
utoipa_swagger_ui::SwaggerUi::new("/docs/{_:.*}")
.url("/docs/openapi.json", openapi::ApiDoc::openapi()),
);
}
#[cfg(any(feature = "olap", feature = "oltp"))]
{
server_app = server_app