Expand description
This crate implements necessary boilerplate code to serve Swagger UI via web server. It provides a simple API to configure the Swagger UI and serve it via a web server. The crate is deliberately kept simple and does not implement any web server specific code. It is up to the user to implement the web server specific code for the web framework of choice.
It does not download Swagger UI from the internet, but rather includes the necessary static files in the crate. This reduces the number of build dependencies and makes it easy to use the crate offline.
It was mainly created to be integrated inside the Cot web framework, but does not depend on it. It can be used with any web framework.
§Attribution
This crate is heavily based on utoipa-swagger-ui
,
licensed under Apache 2.0/MIT.
Swagger UI included in this crate is licensed under Apache 2.0.
Modules§
- oauth
- Implements Swagger UI oauth configuration options.
Structs§
- Basic
Auth - Basic auth options for Swagger UI. By providing
BasicAuth
toConfig::basic_auth
the access to the Swagger UI can be restricted behind given basic authentication. - Config
- Object used to alter Swagger UI settings.
- Swagger
File - Represents servable file of Swagger UI. This is used together with [
serve
] function to serve Swagger UI files via web server. - Swagger
Ui - Entry point for serving Swagger UI and api docs in application. It provides builder style chainable configuration methods for configuring api doc urls.
- Syntax
Highlight - Represents settings related to syntax highlighting of payloads and cURL commands.
- Url
- Rust type for Swagger UI url configuration object.
Enums§
- Swagger
UiStatic File - Represents the static files required by Swagger UI.