Skip to main content

ApplicatorVocabulary

Struct ApplicatorVocabulary 

Source
pub struct ApplicatorVocabulary {
Show 15 fields pub properties: IndexMap<String, SchemaValue>, pub pattern_properties: IndexMap<String, SchemaValue>, pub additional_properties: Option<Box<SchemaValue>>, pub property_names: Option<Box<SchemaValue>>, pub dependent_schemas: IndexMap<String, SchemaValue>, pub items: Option<Box<SchemaValue>>, pub prefix_items: Option<Vec<SchemaValue>>, pub contains: Option<Box<SchemaValue>>, pub all_of: Option<Vec<SchemaValue>>, pub any_of: Option<Vec<SchemaValue>>, pub one_of: Option<Vec<SchemaValue>>, pub not: Option<Box<SchemaValue>>, pub if_: Option<Box<SchemaValue>>, pub then_: Option<Box<SchemaValue>>, pub else_: Option<Box<SchemaValue>>,
}
Expand description

Applicator vocabulary — composition, conditionals, and object/array subschemas.

See JSON Schema Core §10.

Fields§

§properties: IndexMap<String, SchemaValue>

The properties keyword — per-property subschemas.

The value of "properties" MUST be an object. Each value of this object MUST be a valid JSON Schema.

Validation succeeds if, for each name that appears in both the instance and as a name within this keyword’s value, the child instance for that name successfully validates against the corresponding schema.

The annotation result of this keyword is the set of instance property names matched by this keyword. This annotation affects the behavior of "additionalProperties" (in this vocabulary) and "unevaluatedProperties" in the Unevaluated vocabulary.

Omitting this keyword has the same assertion behavior as an empty object.

See JSON Schema Core §10.3.2.1.

§pattern_properties: IndexMap<String, SchemaValue>

The patternProperties keyword — regex-matched property subschemas.

The value of "patternProperties" MUST be an object. Each property name of this object SHOULD be a valid regular expression, according to the ECMA-262 regular expression dialect. Each property value of this object MUST be a valid JSON Schema.

Validation succeeds if, for each instance name that matches any regular expressions that appear as a property name in this keyword’s value, the child instance for that name successfully validates against each schema that corresponds to a matching regular expression.

The annotation result of this keyword is the set of instance property names matched by this keyword. This annotation affects the behavior of "additionalProperties" (in this vocabulary) and "unevaluatedProperties" (in the Unevaluated vocabulary).

Omitting this keyword has the same assertion behavior as an empty object.

See JSON Schema Core §10.3.2.2.

§additional_properties: Option<Box<SchemaValue>>

The additionalProperties keyword — schema for unmatched properties.

The value of "additionalProperties" MUST be a valid JSON Schema.

The behavior of this keyword depends on the presence and annotation results of "properties" and "patternProperties" within the same schema object. Validation with "additionalProperties" applies only to the child values of instance names that do not appear in the annotation results of either "properties" or "patternProperties".

For all such properties, validation succeeds if the child instance validates against the "additionalProperties" schema.

The annotation result of this keyword is the set of instance property names validated by this keyword’s subschema. This annotation affects the behavior of "unevaluatedProperties" in the Unevaluated vocabulary.

Omitting this keyword has the same assertion behavior as an empty schema.

See JSON Schema Core §10.3.2.3.

§property_names: Option<Box<SchemaValue>>

The propertyNames keyword — property name schema.

The value of "propertyNames" MUST be a valid JSON Schema.

If the instance is an object, this keyword validates if every property name in the instance validates against the provided schema. Note the property name that the schema is testing will always be a string.

Omitting this keyword has the same behavior as an empty schema.

See JSON Schema Core §10.3.2.4.

§dependent_schemas: IndexMap<String, SchemaValue>

The dependentSchemas keyword — conditional subschemas by property name.

This keyword specifies subschemas that are evaluated if the instance is an object and contains a certain property.

This keyword’s value MUST be an object. Each value in the object MUST be a valid JSON Schema.

If the object key is a property in the instance, the entire instance must validate against the subschema. Its use is dependent on the presence of the property.

Omitting this keyword has the same behavior as an empty object.

See JSON Schema Core §10.2.2.4.

§items: Option<Box<SchemaValue>>

The items keyword — schema for remaining array items.

The value of "items" MUST be a valid JSON Schema.

This keyword applies its subschema to all instance elements at indexes greater than the length of the "prefixItems" array in the same schema object, as reported by the annotation result of that "prefixItems" keyword. If no such annotation result exists, "items" applies its subschema to all instance array elements. Note that the behavior of "items" without "prefixItems" is identical to that of the schema form of "items" in prior drafts. When "prefixItems" is present, the behavior of "items" is identical to the former "additionalItems" keyword.

If the "items" subschema is applied to any positions within the instance array, it produces an annotation result of boolean true, indicating that all remaining array elements have been evaluated against this keyword’s subschema. This annotation affects the behavior of "unevaluatedItems" in the Unevaluated vocabulary.

Omitting this keyword has the same assertion behavior as an empty schema.

See JSON Schema Core §10.3.1.2.

§prefix_items: Option<Vec<SchemaValue>>

The prefixItems keyword — positional array item schemas.

The value of "prefixItems" MUST be a non-empty array of valid JSON Schemas.

Validation succeeds if each element of the instance validates against the schema at the same position, if any. This keyword does not constrain the length of the array. If the array is longer than this keyword’s value, this keyword validates only the prefix of matching length.

This keyword produces an annotation value which is the largest index to which this keyword applied a subschema. The value MAY be a boolean true if a subschema was applied to every index of the instance, such as is produced by the "items" keyword. This annotation affects the behavior of "items" and "unevaluatedItems".

Omitting this keyword has the same assertion behavior as an empty array.

See JSON Schema Core §10.3.1.1.

§contains: Option<Box<SchemaValue>>

The contains keyword — array containment schema.

The value of this keyword MUST be a valid JSON Schema.

An array instance is valid against "contains" if at least one of its elements is valid against the given schema, except when "minContains" is present and has a value of 0, in which case an array instance MUST be considered valid against the "contains" keyword, even if none of its elements is valid against the given schema.

This keyword produces an annotation value which is an array of the indexes to which this keyword validates successfully when applying its subschema, in ascending order. The value MAY be a boolean true if the subschema validates successfully when applied to every index of the instance.

The subschema MUST be applied to every array element even after the first match has been found, in order to collect annotations for use by other keywords. This is to ensure that all possible annotations are collected.

See JSON Schema Core §10.3.1.3.

§all_of: Option<Vec<SchemaValue>>

The allOf keyword — conjunction of subschemas.

This keyword’s value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.

An instance validates successfully against this keyword if it validates successfully against all schemas defined by this keyword’s value.

See JSON Schema Core §10.2.1.1.

§any_of: Option<Vec<SchemaValue>>

The anyOf keyword — disjunction of subschemas.

This keyword’s value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.

An instance validates successfully against this keyword if it validates successfully against at least one schema defined by this keyword’s value. Note that when annotations are being collected, all subschemas MUST be examined so that annotations are collected from each subschema that validates successfully.

See JSON Schema Core §10.2.1.2.

§one_of: Option<Vec<SchemaValue>>

The oneOf keyword — exclusive disjunction of subschemas.

This keyword’s value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.

An instance validates successfully against this keyword if it validates successfully against exactly one schema defined by this keyword’s value.

See JSON Schema Core §10.2.1.3.

§not: Option<Box<SchemaValue>>

The not keyword — negation.

This keyword’s value MUST be a valid JSON Schema.

An instance is valid against this keyword if it fails to validate successfully against the schema defined by this keyword.

See JSON Schema Core §10.2.1.4.

§if_: Option<Box<SchemaValue>>

The if keyword — conditional guard.

This keyword’s value MUST be a valid JSON Schema.

This validation outcome of this keyword’s subschema has no direct effect on the overall validation result. Rather, it controls which of the "then" or "else" keywords are evaluated.

Instances that successfully validate against this keyword’s subschema MUST also be valid against the subschema value of the "then" keyword, if present.

Instances that fail to validate against this keyword’s subschema MUST also be valid against the subschema value of the "else" keyword, if present.

If annotations are being collected, they are collected from this keyword’s subschema in the usual way, including when the keyword is present without either "then" or "else".

See JSON Schema Core §10.2.2.1.

§then_: Option<Box<SchemaValue>>

The then keyword — consequent subschema.

This keyword’s value MUST be a valid JSON Schema.

When "if" is present, and the instance successfully validates against its subschema, then validation succeeds against this keyword if the instance also successfully validates against this keyword’s subschema.

This keyword has no effect when "if" is absent, or when the instance fails to validate against its subschema. Implementations MUST NOT evaluate the instance against this keyword, for either validation or annotation collection purposes, in such cases.

See JSON Schema Core §10.2.2.2.

§else_: Option<Box<SchemaValue>>

The else keyword — alternative subschema.

This keyword’s value MUST be a valid JSON Schema.

When "if" is present, and the instance fails to validate against its subschema, then validation succeeds against this keyword if the instance successfully validates against this keyword’s subschema.

This keyword has no effect when "if" is absent, or when the instance successfully validates against its subschema. Implementations MUST NOT evaluate the instance against this keyword, for either validation or annotation collection purposes, in such cases.

See JSON Schema Core §10.2.2.3.

Trait Implementations§

Source§

impl Clone for ApplicatorVocabulary

Source§

fn clone(&self) -> ApplicatorVocabulary

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ApplicatorVocabulary

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ApplicatorVocabulary

Source§

fn default() -> ApplicatorVocabulary

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ApplicatorVocabulary

Source§

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 ApplicatorVocabulary

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for ApplicatorVocabulary

Source§

fn eq(&self, other: &ApplicatorVocabulary) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ApplicatorVocabulary

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for ApplicatorVocabulary

Source§

impl StructuralPartialEq for ApplicatorVocabulary

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,