pub struct JsonSchema {Show 24 fields
pub schema: String,
pub id: Option<String>,
pub title: Option<String>,
pub description: Option<String>,
pub schema_type: Option<String>,
pub properties: Option<IndexMap<String, JsonSchema>>,
pub required: Option<Vec<String>>,
pub additional_properties: Option<bool>,
pub items: Option<Box<JsonSchema>>,
pub enum_values: Option<Vec<Value>>,
pub pattern: Option<String>,
pub format: Option<String>,
pub min_length: Option<usize>,
pub max_length: Option<usize>,
pub examples: Option<Vec<Value>>,
pub definitions: Option<IndexMap<String, JsonSchema>>,
pub reference: Option<String>,
pub all_of: Option<Vec<JsonSchema>>,
pub any_of: Option<Vec<JsonSchema>>,
pub one_of: Option<Vec<JsonSchema>>,
pub if_schema: Option<Box<JsonSchema>>,
pub then_schema: Option<Box<JsonSchema>>,
pub else_schema: Option<Box<JsonSchema>>,
pub annotations: IndexMap<String, Value>,
}
Expand description
Complete JSON Schema representation
Fields§
§schema: String
Schema metadata
id: Option<String>
Schema ID/URI
title: Option<String>
Schema title
description: Option<String>
Schema description
schema_type: Option<String>
Schema type
properties: Option<IndexMap<String, JsonSchema>>
Object properties
required: Option<Vec<String>>
Required properties
additional_properties: Option<bool>
Additional properties allowed
items: Option<Box<JsonSchema>>
Array items schema
enum_values: Option<Vec<Value>>
Enum values
pattern: Option<String>
String pattern validation
format: Option<String>
String format
min_length: Option<usize>
Minimum length
max_length: Option<usize>
Maximum length
examples: Option<Vec<Value>>
Examples
definitions: Option<IndexMap<String, JsonSchema>>
Schema definitions
reference: Option<String>
Reference to another schema
all_of: Option<Vec<JsonSchema>>
All of (intersection)
any_of: Option<Vec<JsonSchema>>
Any of (union)
one_of: Option<Vec<JsonSchema>>
One of (exclusive union)
if_schema: Option<Box<JsonSchema>>
Conditional schema
then_schema: Option<Box<JsonSchema>>
Then schema (if condition is true)
else_schema: Option<Box<JsonSchema>>
Else schema (if condition is false)
annotations: IndexMap<String, Value>
Custom annotations
Trait Implementations§
Source§impl Clone for JsonSchema
impl Clone for JsonSchema
Source§fn clone(&self) -> JsonSchema
fn clone(&self) -> JsonSchema
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 moreSource§impl Debug for JsonSchema
impl Debug for JsonSchema
Source§impl Default for JsonSchema
impl Default for JsonSchema
Source§impl<'de> Deserialize<'de> for JsonSchema
impl<'de> Deserialize<'de> for JsonSchema
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 JsonSchema
impl RefUnwindSafe for JsonSchema
impl Send for JsonSchema
impl Sync for JsonSchema
impl Unpin for JsonSchema
impl UnwindSafe for JsonSchema
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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