Struct schemars::schema::RootSchema
source · pub struct RootSchema {
pub meta_schema: Option<String>,
pub schema: SchemaObject,
pub definitions: Map<String, Schema>,
}
Expand description
The root object of a JSON Schema document.
Fields§
§meta_schema: Option<String>
The $schema
keyword.
schema: SchemaObject
The root schema itself.
definitions: Map<String, Schema>
The definitions
keyword.
In JSON Schema draft 2019-09 this was replaced by $defs, but in Schemars this is still
serialized as definitions
for backward-compatibility.
See JSON Schema 8.2.5. Schema Re-Use With “$defs”, and JSON Schema (draft 07) 9. Schema Re-Use With “definitions”.
Trait Implementations§
source§impl Clone for RootSchema
impl Clone for RootSchema
source§fn clone(&self) -> RootSchema
fn clone(&self) -> RootSchema
Returns a copy 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 RootSchema
impl Debug for RootSchema
source§impl Default for RootSchema
impl Default for RootSchema
source§fn default() -> RootSchema
fn default() -> RootSchema
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for RootSchemawhere
RootSchema: Default,
impl<'de> Deserialize<'de> for RootSchemawhere RootSchema: Default,
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
source§impl JsonSchema for RootSchema
impl JsonSchema for RootSchema
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl PartialEq<RootSchema> for RootSchema
impl PartialEq<RootSchema> for RootSchema
source§fn eq(&self, other: &RootSchema) -> bool
fn eq(&self, other: &RootSchema) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.