pub struct JsonSchema {Show 17 fields
pub schema: Option<String>,
pub ref_: Option<String>,
pub defs: Option<BTreeMap<String, JsonSchema>>,
pub type_: Option<SchemaType>,
pub properties: Option<BTreeMap<String, JsonSchema>>,
pub required: Option<Vec<String>>,
pub additional_properties: Option<AdditionalProperties>,
pub items: Option<Box<JsonSchema>>,
pub enum_: Option<Vec<String>>,
pub minimum: Option<i128>,
pub maximum: Option<u128>,
pub one_of: Option<Vec<JsonSchema>>,
pub any_of: Option<Vec<JsonSchema>>,
pub all_of: Option<Vec<JsonSchema>>,
pub description: Option<String>,
pub title: Option<String>,
pub const_: Option<String>,
}Expand description
A JSON Schema definition.
This is a simplified representation that covers the most common cases. It can be serialized to JSON using facet-json.
Fields§
§schema: Option<String>The JSON Schema dialect
ref_: Option<String>Reference to another schema definition
defs: Option<BTreeMap<String, JsonSchema>>Schema definitions for reuse
type_: Option<SchemaType>The type of the schema
properties: Option<BTreeMap<String, JsonSchema>>For objects: the properties
required: Option<Vec<String>>For objects: required property names
additional_properties: Option<AdditionalProperties>For objects: additional properties schema or false
items: Option<Box<JsonSchema>>For arrays: the items schema
enum_: Option<Vec<String>>For strings: enumerated values
minimum: Option<i128>For numbers: minimum value
maximum: Option<u128>For numbers: maximum value
one_of: Option<Vec<JsonSchema>>For oneOf/anyOf/allOf
any_of: Option<Vec<JsonSchema>>§all_of: Option<Vec<JsonSchema>>§description: Option<String>Description from doc comments
title: Option<String>Title (type name)
const_: Option<String>Constant value
Implementations§
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
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