pub struct OpenApiSchema { /* private fields */ }Expand description
OpenAPI schema wrapper
Implementations§
Source§impl OpenApiSchema
impl OpenApiSchema
Sourcepub fn get_type(&self) -> Result<OpenApiType, ComposioError>
pub fn get_type(&self) -> Result<OpenApiType, ComposioError>
Get the type of this schema
Sourcepub fn get_enum_values(&self) -> Option<Vec<Value>>
pub fn get_enum_values(&self) -> Option<Vec<Value>>
Get enum values if this is an enum schema
Sourcepub fn is_composite(&self) -> bool
pub fn is_composite(&self) -> bool
Check if this is a composite schema (oneOf, anyOf, allOf)
Sourcepub fn get_composite_schemas(
&self,
) -> Option<(CompositeType, Vec<OpenApiSchema>)>
pub fn get_composite_schemas( &self, ) -> Option<(CompositeType, Vec<OpenApiSchema>)>
Get composite schemas
Sourcepub fn get_array_items(&self) -> Option<OpenApiSchema>
pub fn get_array_items(&self) -> Option<OpenApiSchema>
Get array item schema
Sourcepub fn get_properties(&self) -> HashMap<String, OpenApiSchema>
pub fn get_properties(&self) -> HashMap<String, OpenApiSchema>
Get object properties
Sourcepub fn get_required(&self) -> Vec<String>
pub fn get_required(&self) -> Vec<String>
Get required property names
Sourcepub fn get_default(&self) -> Option<Value>
pub fn get_default(&self) -> Option<Value>
Get default value
Sourcepub fn get_description(&self) -> Option<String>
pub fn get_description(&self) -> Option<String>
Get description
Sourcepub fn validate(&self, value: &Value) -> Result<(), ComposioError>
pub fn validate(&self, value: &Value) -> Result<(), ComposioError>
Validate a value against this schema
Sourcepub fn to_rust_type_string(&self) -> String
pub fn to_rust_type_string(&self) -> String
Convert to a Rust type description string
Trait Implementations§
Source§impl Clone for OpenApiSchema
impl Clone for OpenApiSchema
Source§fn clone(&self) -> OpenApiSchema
fn clone(&self) -> OpenApiSchema
Returns a duplicate of the value. Read more
1.0.0 · 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 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