pub struct OpenApiGenerator { /* private fields */ }Implementations§
Source§impl OpenApiGenerator
impl OpenApiGenerator
pub fn new(title: &str, version: &str) -> Self
pub fn with_server(self, url: &str, description: Option<&str>) -> Self
pub fn with_description(self, description: &str) -> Self
pub fn with_contact(self, name: &str, email: &str, url: Option<&str>) -> Self
pub fn add_tag(&mut self, name: &str, description: Option<&str>)
pub fn add_schema(&mut self, name: &str, schema: SchemaObject)
pub fn add_route(&mut self, route: &Route)
pub fn add_routes(&mut self, routes: &[Route])
pub fn add_request_body(&mut self, path: &str, method: &str, schema_name: &str)
pub fn add_response( &mut self, path: &str, method: &str, status: &str, schema_name: &str, description: &str, )
pub fn build(self) -> OpenApiSpec
pub fn to_json(&self) -> Result<String>
pub fn to_yaml(&self) -> Result<String>
pub fn write_json(&self, output_path: &Path) -> Result<()>
pub fn write_yaml(&self, output_path: &Path) -> Result<()>
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