pub struct OpenApiConfig {
pub enabled: bool,
pub path: String,
pub servers: Vec<String>,
pub include_undocumented: bool,
pub output: Option<PathBuf>,
}Expand description
The generated OpenAPI document ([openapi] section).
Off by default: a route map is reconnaissance material, and publishing
it should be a decision. The nitr openapi command generates the
document regardless of enabled — the flag gates serving, not
generation.
Fields§
§enabled: boolServe the document at path.
path: StringWhere the document is served (/openapi.json).
servers: Vec<String>The servers list of the document: deployment-level, hence
configuration rather than script.
include_undocumented: boolWhether routes without a doc table still appear, as bare
operations. The default documents everything routable; a route
is kept out with doc = { hidden = true }.
output: Option<PathBuf>Dev mode only: a file rewritten after each successful rebuild when
the document changed, so a committed openapi.json stays current
while nitr dev runs. Production never writes.
Trait Implementations§
Source§impl Clone for OpenApiConfig
impl Clone for OpenApiConfig
Source§impl Debug for OpenApiConfig
impl Debug for OpenApiConfig
Source§impl Default for OpenApiConfig
impl Default for OpenApiConfig
Source§impl<'de> Deserialize<'de> for OpenApiConfigwhere
OpenApiConfig: Default,
impl<'de> Deserialize<'de> for OpenApiConfigwhere
OpenApiConfig: 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 OpenApiConfig
impl RefUnwindSafe for OpenApiConfig
impl Send for OpenApiConfig
impl Sync for OpenApiConfig
impl Unpin for OpenApiConfig
impl UnsafeUnpin for OpenApiConfig
impl UnwindSafe for OpenApiConfig
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