diff --git a/jsonschema-core.xml b/jsonschema-core.xml index b2600944..557f2747 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -1295,6 +1295,24 @@ Omitting this keyword has the same behavior as an empty schema. + +
+ + 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 dependency value. + + + Omitting this keyword has the same behavior as an empty object. + +
@@ -1625,6 +1643,7 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0 Moved "definitions" from the Validation specification here as "$defs" Moved applicator keywords from the Validation specification as their own vocabulary + Moved "dependencies" from the Validation specification, but only the schema form diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index ab1b1a47..f0123a33 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -223,10 +223,6 @@ Validation keywords in a schema impose requirements for successful validation of an instance. These keywords are all assertions without any annotation behavior. - - "dependencies" has applicator behavior, but this keyword will be split - into separate assertion and applicator keywords before the next draft publication. -
@@ -454,36 +450,21 @@
-
+
- - This keyword may be split into two, with the variation that uses - an array of property names rather than a subschema getting a new - name. The dual behavior is confusing and relatively difficult to - implement. In the previous draft, we proposed dropping the keyword - altogether, or dropping one of its forms, but we received feedback - in support of keeping it. See issues #442 and #528 at - <https://github.com/json-schema-org/json-schema-spec/issues> - for further discussion. Further feedback is encouraged. - - - - This keyword specifies rules that are evaluated if the instance is an object and - contains a certain property. + The value of this keyword MUST be an object. Properties in + this object, if any, MUST be arrays. Elements in each array, + if any, MUST be strings, and MUST be unique. - This keyword's value MUST be an object. Each property specifies a dependency. - Each dependency value MUST be an array or a valid JSON Schema. + This keyword specifies properties that are required if a specific + other property is present. - If the dependency value is a subschema, and the dependency key is a property - in the instance, the entire instance must validate against the dependency value. - - - If the dependency value is an array, each element in the array, - if any, MUST be a string, and MUST be unique. If the dependency key is - a property in the instance, each of the items in the dependency - value must be a property that exists in the instance. + Validation succeeds if, for each name that appears in both + the instance and as a name within this keyword's value, every + item in the corresponding array is also the name of a property + in the instance. Omitting this keyword has the same behavior as an empty object. @@ -1067,6 +1048,18 @@ as a generic mechanism on which validation, hyper-schema, and extension vocabularies can all be based + + This keyword had two different modes of behavior, which made it + relatively challenging to implement and reason about. + The schema form has been moved to Core under the original + "dependencies" keyword, as part of the applicator vocabulary. + It is analogous to "properties", except that instead of applying + its subschema to the property value, it applies it to the object + containing the property. + The property name array form is retained here and renamed to + "requiredDependencies", as it is an assertion which is a shortcut + for the conditional use of the "required" assertion keyword. +
@@ -1106,6 +1099,7 @@ Moved "definitions" to the core spec as "$defs" Moved applicator keywords to the core spec + Renamed the array form of "dependencies" to "requiredDependencies", moved the schema form to the core spec