[−][src]Struct tamasfe_schemars::schema::SchemaObject
A JSON Schema object.
Fields
metadata: Option<Box<Metadata>>
Properties which annotate the SchemaObject
which typically have no effect when an object is being validated against the schema.
instance_type: Option<SingleOrVec<InstanceType>>
The type
keyword.
See JSON Schema Validation 6.1.1. "type" and JSON Schema 4.2.1. Instance Data Model.
format: Option<String>
The format
keyword.
See JSON Schema Validation 7. A Vocabulary for Semantic Content With "format".
enum_values: Option<Vec<Value>>
The enum
keyword.
const_value: Option<Value>
The const
keyword.
subschemas: Option<Box<SubschemaValidation>>
Properties of the SchemaObject
which define validation assertions in terms of other schemas.
number: Option<Box<NumberValidation>>
Properties of the SchemaObject
which define validation assertions for numbers.
string: Option<Box<StringValidation>>
Properties of the SchemaObject
which define validation assertions for strings.
array: Option<Box<ArrayValidation>>
Properties of the SchemaObject
which define validation assertions for arrays.
object: Option<Box<ObjectValidation>>
Properties of the SchemaObject
which define validation assertions for objects.
reference: Option<String>
The $ref
keyword.
extensions: Map<String, Value>
Arbitrary extra properties which are not part of the JSON Schema specification, or which schemars
does not support.
Implementations
impl SchemaObject
[src]
pub fn new_ref(reference: String) -> Self
[src]
Creates a new $ref
schema.
The given reference string should be a URI reference. This will usually be a JSON Pointer in URI Fragment representation.
pub fn is_ref(&self) -> bool
[src]
Returns true
if self
is a $ref
schema.
If self
has Some
reference
set, this returns true
.
Otherwise, returns false
.
pub fn metadata(&mut self) -> &mut Metadata
[src]
Returns a mutable reference to this schema's Metadata
, creating it if it was None
.
pub fn subschemas(&mut self) -> &mut SubschemaValidation
[src]
Returns a mutable reference to this schema's SubschemaValidation
, creating it if it was None
.
pub fn number(&mut self) -> &mut NumberValidation
[src]
Returns a mutable reference to this schema's NumberValidation
, creating it if it was None
.
pub fn string(&mut self) -> &mut StringValidation
[src]
Returns a mutable reference to this schema's StringValidation
, creating it if it was None
.
pub fn array(&mut self) -> &mut ArrayValidation
[src]
Returns a mutable reference to this schema's ArrayValidation
, creating it if it was None
.
pub fn object(&mut self) -> &mut ObjectValidation
[src]
Returns a mutable reference to this schema's ObjectValidation
, creating it if it was None
.
Trait Implementations
impl Clone for SchemaObject
[src]
fn clone(&self) -> SchemaObject
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SchemaObject
[src]
impl Default for SchemaObject
[src]
fn default() -> SchemaObject
[src]
impl<'de> Deserialize<'de> for SchemaObject where
SchemaObject: Default,
[src]
SchemaObject: Default,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<Schema> for SchemaObject
[src]
impl From<SchemaObject> for Schema
[src]
fn from(o: SchemaObject) -> Self
[src]
impl JsonSchema for SchemaObject
[src]
fn schema_name() -> String
[src]
fn json_schema(gen: &mut SchemaGenerator) -> Schema
[src]
fn is_referenceable() -> bool
[src]
impl PartialEq<SchemaObject> for SchemaObject
[src]
fn eq(&self, other: &SchemaObject) -> bool
[src]
fn ne(&self, other: &SchemaObject) -> bool
[src]
impl Serialize for SchemaObject
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for SchemaObject
[src]
Auto Trait Implementations
impl RefUnwindSafe for SchemaObject
impl Send for SchemaObject
impl Sync for SchemaObject
impl Unpin for SchemaObject
impl UnwindSafe for SchemaObject
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,