pub struct OpenAPIGenerator { /* private fields */ }Implementations§
Source§impl OpenAPIGenerator
impl OpenAPIGenerator
pub fn new() -> Self
pub fn with_info(self, info: Value) -> Self
Sourcepub fn register_path(&mut self, path: &str, info: PathInfo) -> &mut Self
pub fn register_path(&mut self, path: &str, info: PathInfo) -> &mut Self
Registers a (path, method) operation. Multiple methods for the same path are merged into the same paths entry.
Sourcepub fn register_schema(&mut self, name: &str, schema: Schema) -> &mut Self
pub fn register_schema(&mut self, name: &str, schema: Schema) -> &mut Self
Registers a reusable Schema definition
Sourcepub fn register_security_scheme(
&mut self,
name: &str,
scheme: SecurityScheme,
) -> &mut Self
pub fn register_security_scheme( &mut self, name: &str, scheme: SecurityScheme, ) -> &mut Self
Registers a reusable SecurityScheme
Sourcepub fn add_server(&mut self, server: Server) -> &mut Self
pub fn add_server(&mut self, server: Server) -> &mut Self
Adds an environment server
Sourcepub fn with_global_security(self, req: SecurityRequirement) -> Self
pub fn with_global_security(self, req: SecurityRequirement) -> Self
Sets the global security requirement
Sourcepub fn generate(&self) -> OpenAPISpec
pub fn generate(&self) -> OpenAPISpec
Generates the OpenAPISpec
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OpenAPIGenerator
impl RefUnwindSafe for OpenAPIGenerator
impl Send for OpenAPIGenerator
impl Sync for OpenAPIGenerator
impl Unpin for OpenAPIGenerator
impl UnsafeUnpin for OpenAPIGenerator
impl UnwindSafe for OpenAPIGenerator
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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