pub struct MountOpts {
pub spec_path: String,
pub ui_path: String,
pub mount_ui: bool,
pub scalar: ScalarConfig,
}Expand description
Configuration for mount_docs.
All fields have sensible defaults; override only what differs from
the convention. The struct is intentionally builder-only — prefer
MountOpts::default() followed by chained setters over struct
literal construction so future field additions remain additive.
Fields§
§spec_path: StringPath at which the raw OpenAPI JSON is served. Defaults to
"/openapi.json".
ui_path: StringPath at which the documentation UI is mounted. Defaults to
"/docs". Only honored when at least one UI feature is enabled
at compile time.
mount_ui: boolWhether to mount the documentation UI. Defaults to true. Set
to false to expose only the raw JSON without an interactive
viewer.
scalar: ScalarConfigScalar UI rendering options. Defaults to
ScalarConfig::default(), which renders
the historical out-of-the-box appearance (three-pane modern
layout, dark mode on, schemas index hidden, codegen sidebar
suppressed, agent / MCP integrations disabled). Only honored
when the docs-scalar feature is enabled at compile time.
Implementations§
Source§impl MountOpts
impl MountOpts
Sourcepub fn spec_path(self, path: impl Into<String>) -> Self
pub fn spec_path(self, path: impl Into<String>) -> Self
Use the supplied path for the raw OpenAPI JSON endpoint.
Sourcepub fn ui_path(self, path: impl Into<String>) -> Self
pub fn ui_path(self, path: impl Into<String>) -> Self
Use the supplied path for the documentation UI mount point.
Sourcepub fn without_ui(self) -> Self
pub fn without_ui(self) -> Self
Disable the documentation UI mount, exposing only the JSON endpoint.
Sourcepub fn scalar(self, cfg: ScalarConfig) -> Self
pub fn scalar(self, cfg: ScalarConfig) -> Self
Override the Scalar UI configuration.
§Example
use doxa::{MountOpts, ScalarConfig, ScalarLayout, ScalarTheme};
let opts = MountOpts::default().scalar(
ScalarConfig::default()
.layout(ScalarLayout::Classic)
.theme(ScalarTheme::Solarized)
.dark_mode(false),
);