pub struct Schema {Show 39 fields
pub ref_path: Option<String>,
pub schema_type: Option<SchemaType>,
pub format: Option<String>,
pub title: Option<String>,
pub description: Option<String>,
pub default: Option<Value>,
pub example: Option<Value>,
pub examples: Option<Vec<Value>>,
pub minimum: Option<f64>,
pub maximum: Option<f64>,
pub exclusive_minimum: Option<bool>,
pub exclusive_maximum: Option<bool>,
pub multiple_of: Option<f64>,
pub min_length: Option<usize>,
pub max_length: Option<usize>,
pub pattern: Option<String>,
pub items: Option<Box<SchemaRef>>,
pub prefix_items: Option<Vec<SchemaRef>>,
pub min_items: Option<usize>,
pub max_items: Option<usize>,
pub unique_items: Option<bool>,
pub properties: Option<BTreeMap<String, SchemaRef>>,
pub required: Option<Vec<String>>,
pub additional_properties: Option<Value>,
pub min_properties: Option<usize>,
pub max_properties: Option<usize>,
pub enum: Option<Vec<Value>>,
pub all_of: Option<Vec<SchemaRef>>,
pub any_of: Option<Vec<SchemaRef>>,
pub one_of: Option<Vec<SchemaRef>>,
pub not: Option<Box<SchemaRef>>,
pub discriminator: Option<Discriminator>,
pub nullable: Option<bool>,
pub read_only: Option<bool>,
pub write_only: Option<bool>,
pub external_docs: Option<ExternalDocumentation>,
pub defs: Option<BTreeMap<String, Schema>>,
pub dynamic_anchor: Option<String>,
pub dynamic_ref: Option<String>,
}vespera and (crate features utoipa or vespera) only.Expand description
JSON Schema definition
Fields§
§ref_path: Option<String>Schema reference ($ref) - if present, other fields are ignored
schema_type: Option<SchemaType>Schema type
format: Option<String>Format (for numbers or strings)
title: Option<String>Title
description: Option<String>Description
default: Option<Value>Default value
example: Option<Value>Example
examples: Option<Vec<Value>>Examples
minimum: Option<f64>Minimum value
maximum: Option<f64>Maximum value
exclusive_minimum: Option<bool>Exclusive minimum
exclusive_maximum: Option<bool>Exclusive maximum
multiple_of: Option<f64>Multiple of
min_length: Option<usize>Minimum length
max_length: Option<usize>Maximum length
pattern: Option<String>Pattern (regex)
items: Option<Box<SchemaRef>>Array item schema
prefix_items: Option<Vec<SchemaRef>>Prefix items for tuple arrays (OpenAPI 3.1 / JSON Schema 2020-12)
min_items: Option<usize>Minimum number of items
max_items: Option<usize>Maximum number of items
unique_items: Option<bool>Unique items flag
properties: Option<BTreeMap<String, SchemaRef>>Property definitions
required: Option<Vec<String>>List of required properties
additional_properties: Option<Value>Whether additional properties are allowed (can be boolean or SchemaRef)
min_properties: Option<usize>Minimum number of properties
max_properties: Option<usize>Maximum number of properties
enum: Option<Vec<Value>>Enum values
all_of: Option<Vec<SchemaRef>>All conditions must be satisfied (AND)
any_of: Option<Vec<SchemaRef>>At least one condition must be satisfied (OR)
one_of: Option<Vec<SchemaRef>>Exactly one condition must be satisfied (XOR)
not: Option<Box<SchemaRef>>Condition must not be satisfied (NOT)
discriminator: Option<Discriminator>Discriminator for polymorphic schemas (used with oneOf/anyOf/allOf)
nullable: Option<bool>Nullable flag
read_only: Option<bool>Read-only flag
write_only: Option<bool>Write-only flag
external_docs: Option<ExternalDocumentation>External documentation reference
defs: Option<BTreeMap<String, Schema>>Definitions ($defs) - reusable schema definitions
dynamic_anchor: Option<String>Dynamic anchor ($dynamicAnchor) - defines a dynamic anchor
dynamic_ref: Option<String>Dynamic reference ($dynamicRef) - references a dynamic anchor
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Schema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Schema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Schema
impl Serialize for Schema
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more