pub struct OpenApiBuilder { /* private fields */ }Expand description
Builder for constructing an OpenAPI spec from plugins and core routes.
Implementations§
Source§impl OpenApiBuilder
impl OpenApiBuilder
pub fn new( title: impl Into<String>, version: impl Into<String>, ) -> OpenApiBuilder
pub fn description(self, desc: impl Into<String>) -> OpenApiBuilder
Sourcepub fn route(
self,
method: &HttpMethod,
path: &str,
operation_id: &str,
tag: &str,
) -> OpenApiBuilder
pub fn route( self, method: &HttpMethod, path: &str, operation_id: &str, tag: &str, ) -> OpenApiBuilder
Add a single route entry.
Sourcepub fn plugin<DB>(self, plugin: &dyn AuthPlugin<DB>) -> OpenApiBuilderwhere
DB: DatabaseAdapter,
pub fn plugin<DB>(self, plugin: &dyn AuthPlugin<DB>) -> OpenApiBuilderwhere
DB: DatabaseAdapter,
Register all routes from a plugin.
Sourcepub fn core_routes(self) -> OpenApiBuilder
pub fn core_routes(self) -> OpenApiBuilder
Register core routes that are not part of any plugin.
Sourcepub fn build(self) -> OpenApiSpec
pub fn build(self) -> OpenApiSpec
Build the final OpenAPI spec.
Auto Trait Implementations§
impl Freeze for OpenApiBuilder
impl RefUnwindSafe for OpenApiBuilder
impl Send for OpenApiBuilder
impl Sync for OpenApiBuilder
impl Unpin 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