pub struct SwaggerConfig {
pub enabled: bool,
pub path: String,
pub oauth2: Option<SwaggerOAuth2Config>,
}Expand description
Swagger UI + embedded OpenAPI spec ([swagger] block).
Enabled by default — when the binary was built with the swagger
cargo feature, an interactive Swagger UI is served at
SwaggerConfig::path (default /docs) and the raw OpenAPI JSON
at <path>/openapi.json. Set enabled = false in datasets.toml
to suppress it (e.g. in prod). When the binary was built without
the feature, enabled = true is harmless: the server logs a
warning at startup and skips the mount.
To let users sign in to the UI itself (Authorization Code + PKCE
against any OIDC provider), populate the optional [swagger.oauth2]
sub-block. Acquired tokens are attached as Authorization: Bearer …
to every “Try it out” request — useful for exercising auth-protected
endpoints from the docs page. This drives the UI only; it does not
turn on server-side token validation.
Fields§
§enabled: bool§path: String§oauth2: Option<SwaggerOAuth2Config>Trait Implementations§
Source§impl Clone for SwaggerConfig
impl Clone for SwaggerConfig
Source§fn clone(&self) -> SwaggerConfig
fn clone(&self) -> SwaggerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more