Module utoipa::swagger_ui
source · [−]Expand description
Provides implementations to serve Swagger UI.
While serving Swagger UI is framework independant. Uotipa implements the boiler plate for few frameworks.
Currently supported frameworks by boiler plate implementations:
- actix-web
Examples
Serve Swagger UI with api doc via actix-web. 1
let _ = HttpServer::new(move || {
App::new()
.service(
SwaggerUi::new("/swagger-ui/{_:.*}")
.with_url("/api-doc/openapi.json", ApiDoc::openapi()),
)
})
.bind(format!("{}:{}", Ipv4Addr::UNSPECIFIED, 8989)).unwrap()
.run();
actix-web feature need to be enabled. ↩