From 074450ab4e00aa280a7e6eb1dff19eaac9b152a7 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Thu, 21 Oct 2021 14:05:32 -0700 Subject: [PATCH] Add propertyDependencies keyword --- jsonschema-core.xml | 20 ++++++++++++++++++++ meta/applicator.json | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 15d524de..cd846736 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2265,6 +2265,25 @@ Omitting this keyword has the same behavior as an empty object. +
+ + This keyword specifies subschemas that are evaluated if the instance is + an object and contains a certain property with a certain string value. + + + This keyword's value MUST be an object. Each value in the object MUST be + an object whose values MUST be valid JSON Schemas. + + + If the outer object key is a property in the instance and the inner + object key is equal to the value of that property, the entire instance + must validate against the schema. Its use is dependent on the presence + and value of the property. + + + Omitting this keyword has the same behavior as an empty object. + +
@@ -3859,6 +3878,7 @@ https://example.com/schemas/common#/$defs/count/minimum "contains" now applies to objects as well as arrays Remove bookending requirement for "$dynamicRef" + Add "propertyDependencies" keyword diff --git a/meta/applicator.json b/meta/applicator.json index 948f4193..1b2f8c2e 100644 --- a/meta/applicator.json +++ b/meta/applicator.json @@ -29,6 +29,15 @@ "additionalProperties": { "$dynamicRef": "#meta" }, "default": {} }, + "propertyDependencies": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { "$dynamicRef": "#meta" }, + "default": {} + }, + "default": {} + }, "propertyNames": { "$dynamicRef": "#meta" }, "if": { "$dynamicRef": "#meta" }, "then": { "$dynamicRef": "#meta" },