Applicator Vocabulary Official Included By Default
A vocabulary that defines applicator keywords that are recommended for use as the basis of other vocabularies.
Dialect | 2020-12 |
---|---|
URI | https://json-schema.org/draft/2020-12/vocab/applicator |
Specification | https://json-schema.org/draft/2020-12/json-schema-core.html#section-10 |
Authors | |
Metaschema | https://json-schema.org/draft/2020-12/meta/applicator |
Also see |
Your metaschema is likely already declaring this vocabulary
This vocabulary is included by default when using the official metaschema of this dialect: https://json-schema.org/draft/2020-12/schema. Unless you are using a custom metaschema, there is nothing else you need to do.
To make use of this vocabulary, modify your metaschema to declare the use of this vocabulary using the $vocabulary keyword and evaluate its metaschema. If the vocabulary must be present for an implementation to proceed:
{
...
"$vocabulary": {
...
"https://json-schema.org/draft/2020-12/vocab/applicator": true
},
"allOf": [
{ "$ref": "https://json-schema.org/draft/2020-12/meta/applicator" }
]
}
Otherwise, if it is optional for implementations to understand this vocabulary to proceed:
{
...
"$vocabulary": {
...
"https://json-schema.org/draft/2020-12/vocab/applicator": false
},
"allOf": [
{ "$ref": "https://json-schema.org/draft/2020-12/meta/applicator" }
]
}
Keywords
Keyword | Kind | Instance | Summary |
---|---|---|---|
oneOf | Applicator | Any | An instance validates successfully against this keyword if it validates successfully against exactly one schema defined by this keyword’s value. |
allOf | Applicator | Any | An instance validates successfully against this keyword if it validates successfully against all schemas defined by this keyword’s value. |
anyOf | Applicator | Any | An instance validates successfully against this keyword if it validates successfully against at least one schema defined by this keyword’s value. |
if | Applicator | Any | This keyword declares a condition based on the validation result of the given schema. |
then | Applicator | Any | 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. |
else | Applicator | Any | 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. |
not | Applicator | Any | An instance is valid against this keyword if it fails to validate successfully against the schema defined by this keyword. |
properties | Applicator Annotation | Object | 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. |
patternProperties | Applicator Annotation | Object | 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. |
additionalProperties | Applicator Annotation | Object | Validation succeeds if the schema validates against each value not matched by other object applicators in this vocabulary. |
dependentSchemas | Applicator | Object | This keyword specifies subschemas that are evaluated if the instance is an object and contains a certain property. |
propertyNames | Applicator | Object | Validation succeeds if the schema validates against every property name in the instance. |
prefixItems | Applicator Annotation | Array | Validation succeeds if each element of the instance validates against the schema at the same position, if any. |
contains | Applicator Annotation | Array | Validation succeeds if the instance contains an element that validates against this schema. |
items | Applicator Annotation | Array | Validation succeeds if each element of the instance not covered by prefixItems validates against this schema. |