pub struct OpenApiBuilder { /* private fields */ }Expand description
Builder for OpenAPI specifications
Implementations§
Source§impl OpenApiBuilder
impl OpenApiBuilder
Sourcepub fn new(title: impl Into<String>, version: impl Into<String>) -> Self
pub fn new(title: impl Into<String>, version: impl Into<String>) -> Self
Create a new OpenAPI builder
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set description
Sourcepub fn terms_of_service(self, terms: impl Into<String>) -> Self
pub fn terms_of_service(self, terms: impl Into<String>) -> Self
Set terms of service
Sourcepub fn contact(
self,
name: Option<String>,
url: Option<String>,
email: Option<String>,
) -> Self
pub fn contact( self, name: Option<String>, url: Option<String>, email: Option<String>, ) -> Self
Add contact information
Sourcepub fn security_scheme(
self,
name: impl Into<String>,
scheme: SecurityScheme,
) -> Self
pub fn security_scheme( self, name: impl Into<String>, scheme: SecurityScheme, ) -> Self
Add a security scheme
Sourcepub fn security(self, requirement: SecurityRequirement) -> Self
pub fn security(self, requirement: SecurityRequirement) -> Self
Add global security requirement
Sourcepub fn build(self) -> OpenApiSpec
pub fn build(self) -> OpenApiSpec
Build the OpenAPI specification
Source§impl OpenApiBuilder
Helper functions for creating common components
impl OpenApiBuilder
Helper functions for creating common components
Sourcepub fn add_bearer_auth(self, name: impl Into<String>) -> Self
pub fn add_bearer_auth(self, name: impl Into<String>) -> Self
Add Bearer JWT authentication
Sourcepub fn add_api_key_auth(
self,
name: impl Into<String>,
key_name: impl Into<String>,
location: ApiKeyLocation,
) -> Self
pub fn add_api_key_auth( self, name: impl Into<String>, key_name: impl Into<String>, location: ApiKeyLocation, ) -> Self
Add API key authentication
Trait Implementations§
Source§impl Clone for OpenApiBuilder
impl Clone for OpenApiBuilder
Source§fn clone(&self) -> OpenApiBuilder
fn clone(&self) -> OpenApiBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OpenApiBuilder
impl RefUnwindSafe for OpenApiBuilder
impl Send for OpenApiBuilder
impl Sync for OpenApiBuilder
impl Unpin for OpenApiBuilder
impl UnsafeUnpin for OpenApiBuilder
impl UnwindSafe for OpenApiBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<R, D> DepsPresent<D> for R
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging