pub struct SwaggerConfig {Show 14 fields
pub enabled: bool,
pub path: String,
pub title: Option<String>,
pub spec_url: Option<String>,
pub allow_external_spec: bool,
pub deep_linking: bool,
pub doc_expansion: String,
pub filter: bool,
pub try_it_out: bool,
pub display_request_duration: bool,
pub persist_authorization: bool,
pub display_operation_id: bool,
pub default_models_expand_depth: i64,
pub options: BTreeMap<String, Value>,
}Expand description
The Swagger UI page ([swagger] section).
The page is the vendored Swagger UI bundle served from this binary:
no CDN, no network, and a Content-Security-Policy that forbids
inline script. Needs [openapi] enabled (or an explicit spec_url).
Fields§
§enabled: boolServe the page at path.
path: StringWhere the page is served (/docs); its assets live under
<path>/assets/<version>/.
title: Option<String>The page <title>; defaults to the app:doc title.
spec_url: Option<String>The document the page loads; defaults to [openapi] path. A URL
with an origin needs allow_external_spec.
allow_external_spec: boolAllow spec_url on another origin, widening the page’s
connect-src to exactly that origin.
deep_linking: boolSwagger UI deepLinking.
doc_expansion: StringSwagger UI docExpansion: "list", "full" or "none".
filter: boolSwagger UI filter: the operation filter box.
try_it_out: boolSwagger UI tryItOutEnabled: whether “Try it out” starts enabled.
display_request_duration: boolSwagger UI displayRequestDuration.
Swagger UI persistAuthorization. Off by default: it keeps entered
tokens in the browser’s localStorage.
display_operation_id: boolSwagger UI displayOperationId.
default_models_expand_depth: i64Swagger UI defaultModelsExpandDepth.
options: BTreeMap<String, Value>Further Swagger UI options, passed verbatim (camelCase keys). May
not repeat a typed setting above under its camelCase name, nor set
url or dom_id, which the page owns.
Trait Implementations§
Source§impl Clone for SwaggerConfig
impl Clone for SwaggerConfig
Source§impl Debug for SwaggerConfig
impl Debug for SwaggerConfig
Source§impl Default for SwaggerConfig
impl Default for SwaggerConfig
Source§impl<'de> Deserialize<'de> for SwaggerConfigwhere
SwaggerConfig: Default,
impl<'de> Deserialize<'de> for SwaggerConfigwhere
SwaggerConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SwaggerConfig
impl RefUnwindSafe for SwaggerConfig
impl Send for SwaggerConfig
impl Sync for SwaggerConfig
impl Unpin for SwaggerConfig
impl UnsafeUnpin for SwaggerConfig
impl UnwindSafe for SwaggerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more