pub struct OpenApiSchema { /* private fields */ }Expand description
Represents OpenAPI schema.
Implementations§
Source§impl OpenApiSchema
impl OpenApiSchema
Sourcepub fn with_constraint(self, constraint: SchemaConstraint) -> Self
pub fn with_constraint(self, constraint: SchemaConstraint) -> Self
Applies a constraint to this schema
Sourcepub fn array(items: OpenApiSchema) -> Self
pub fn array(items: OpenApiSchema) -> Self
Generates schema for an array of items
Sourcepub fn from_example(example: &Value) -> Self
pub fn from_example(example: &Value) -> Self
Generates schema from example
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Sets the title
Sourcepub fn with_property(
self,
name: impl Into<String>,
schema: OpenApiSchema,
) -> Self
pub fn with_property( self, name: impl Into<String>, schema: OpenApiSchema, ) -> Self
Sets the property schema
Sourcepub fn with_format(self, fmt: impl Into<String>) -> Self
pub fn with_format(self, fmt: impl Into<String>) -> Self
Sets the format
Sourcepub fn with_required<I, T>(self, required: I) -> Self
pub fn with_required<I, T>(self, required: I) -> Self
Sets the required fields for schema
Trait Implementations§
Source§impl Clone for OpenApiSchema
impl Clone for OpenApiSchema
Source§impl Debug for OpenApiSchema
impl Debug for OpenApiSchema
Source§impl Default for OpenApiSchema
impl Default for OpenApiSchema
Source§impl<'de> Deserialize<'de> for OpenApiSchema
impl<'de> Deserialize<'de> for OpenApiSchema
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OpenApiSchema
impl RefUnwindSafe for OpenApiSchema
impl Send for OpenApiSchema
impl Sync for OpenApiSchema
impl Unpin for OpenApiSchema
impl UnsafeUnpin for OpenApiSchema
impl UnwindSafe for OpenApiSchema
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