pub struct Schema {
pub schema_type: Option<String>,
pub format: Option<String>,
pub description: Option<String>,
pub title: Option<String>,
pub default: Option<Value>,
pub enum_values: Option<Vec<String>>,
pub required: Option<Vec<String>>,
pub property_ordering: Option<Vec<String>>,
pub items: Option<Box<Schema>>,
pub properties: Option<HashMap<String, Schema>>,
pub example: Option<Value>,
}Expand description
A JSON Schema definition used to describe function parameters and responses.
This is a recursive type that can describe nested object structures.
Fields§
§schema_type: Option<String>The data type (e.g., “STRING”, “NUMBER”, “OBJECT”, “ARRAY”).
format: Option<String>The format of the data (e.g., “int32”, “date-time”).
description: Option<String>A description of what this schema represents.
title: Option<String>The title of this schema.
default: Option<Value>A default value for this schema.
enum_values: Option<Vec<String>>Allowed enum values for this field.
required: Option<Vec<String>>Required property names (for object types).
property_ordering: Option<Vec<String>>Property ordering hints.
items: Option<Box<Schema>>Schema for array items.
properties: Option<HashMap<String, Schema>>Named properties (for object types).
example: Option<Value>An example value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
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 Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnwindSafe for Schema
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