Expand description
swagger-ui-dist redistributes the swagger ui
it repackages the JS/CSS code into axum routes to allow for an easier implementation
let api_def = ApiDefinition {
uri_prefix: "/api",
api_definition: OpenApiSource::Inline(include_str!("petstore.yaml")),
title: Some("My Super Duper API"),
};
let app = Router::new().merge(swagger_ui_dist::generate_routes(api_def));
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
println!("listening on http://localhost:3000/api");
axum::serve(listener, app).await.unwrap();
Structs§
- ApiDefinition
- Configuration for the API definition
Enums§
- Open
ApiSource - Provide the OpenAPi Spec either Inline or as Url
Functions§
- generate_
routes - Generate the route for Axum depending on the given configuration