From d0a73b8c46ddc1f0b81d3cd5a9fc6f34bdd548d1 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Mon, 1 Nov 2021 12:28:50 -0700 Subject: [PATCH 1/8] Add requireAllExcept keyword --- jsonschema-validation.xml | 13 +++++++++++++ meta/validation.json | 1 + 2 files changed, 14 insertions(+) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index a8426471..815731b8 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -493,6 +493,18 @@ +
+ + The value of this keyword MUST be an array. + Elements of this array, if any, MUST be strings, and MUST be unique. + + + An object instance is valid against this keyword if every property name + declared in "properties" except those that appear in the array is the name + of a property in the instance. + +
+
The value of this keyword MUST be an object. Properties in @@ -1445,6 +1457,7 @@ Use IRIs instead of URIs + Add the "requireAllExcept" keyword diff --git a/meta/validation.json b/meta/validation.json index 69d52e95..c8e8f55d 100644 --- a/meta/validation.json +++ b/meta/validation.json @@ -61,6 +61,7 @@ "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" }, "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, "required": { "$ref": "#/$defs/stringArray" }, + "allRequiredExcept": { "$ref": "#/$defs/stringArray" }, "dependentRequired": { "type": "object", "additionalProperties": { From 76b5c795857b35dfdbd679753eeed413017a8320 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Mon, 1 Nov 2021 15:16:23 -0700 Subject: [PATCH 2/8] Improve requiredAllExcept wording Co-authored-by: Karen Etheridge --- jsonschema-validation.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index 815731b8..0e97fb63 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -500,8 +500,8 @@ An object instance is valid against this keyword if every property name - declared in "properties" except those that appear in the array is the name - of a property in the instance. + declared in "properties" is the name of a property in the instance, with + the exception of the property names that appear in this keyword's array.
From e7a0accde42693b106a40c28ee8a3d37e4f66e54 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Fri, 27 May 2022 12:59:42 -0700 Subject: [PATCH 3/8] Update jsonschema-validation.xml Co-authored-by: Ben Hutton --- jsonschema-validation.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index 0e97fb63..a412ce7f 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -500,8 +500,9 @@ An object instance is valid against this keyword if every property name - declared in "properties" is the name of a property in the instance, with - the exception of the property names that appear in this keyword's array. + declared in "properties" within the same schema object is the name of + a property in the instance, with the exception of the property names + that appear in this keyword's array. From 14c2d59e7ba2432b817853f8e3dbb78715114e4d Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Fri, 27 May 2022 13:10:44 -0700 Subject: [PATCH 4/8] Add a Keyword independence section for requiredAllExcept --- jsonschema-validation.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index a412ce7f..a8e3f0a5 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -214,6 +214,22 @@ . +
+ + Schema keywords typically operate independently, without + affecting each other's outcomes. + + + For schema author convenience, there are some exceptions among the + keywords in this vocabulary: + + + "requiredAllExcept", whose behavior is defined in terms of "properties" + + + +
+
From 9d3e72cd1dbe6a3aaccbfa27dc24690d370d7d1e Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Wed, 1 Jun 2022 12:40:01 -0700 Subject: [PATCH 5/8] Reword requireAllExcept to avoid misunderstanding It was pointed out that the previous wording could be mistaken to mean that properties were forbidden rather than optional. --- jsonschema-validation.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index a8e3f0a5..ba57824b 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -515,10 +515,12 @@ Elements of this array, if any, MUST be strings, and MUST be unique. - An object instance is valid against this keyword if every property name - declared in "properties" within the same schema object is the name of - a property in the instance, with the exception of the property names - that appear in this keyword's array. + This keyword specifies properties that are required based on the property + names declared in a "properties" keyword within the same schema object. + The set of required properites is the set of property names declared in + "properties" minus the set of property names declared in this keyword's + array. An object instance is valid against this keyword if it has defined + properties for each of the property names in this set of required properties.
From 59449e8e05906af56c132dfa171cffc0ce09da4a Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Wed, 1 Jun 2022 12:50:13 -0700 Subject: [PATCH 6/8] Add min/maxContains to Keyword Indepenence list --- jsonschema-validation.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index ba57824b..5392d482 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -225,6 +225,8 @@ "requiredAllExcept", whose behavior is defined in terms of "properties" + "minContains", whose behavior is defined in terms of "contains" + "maxContains", whose behavior is defined in terms of "contains" From 0367f268f34b3c79f4a972aa7ed30e68f857f808 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Wed, 1 Jun 2022 13:04:39 -0700 Subject: [PATCH 7/8] Fix typo in requireAllExcept meta-schema --- jsonschema-validation.xml | 4 ++-- meta/validation.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index 5392d482..82d8a4c6 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -224,7 +224,7 @@ keywords in this vocabulary: - "requiredAllExcept", whose behavior is defined in terms of "properties" + "requireAllExcept", whose behavior is defined in terms of "properties" "minContains", whose behavior is defined in terms of "contains" "maxContains", whose behavior is defined in terms of "contains" @@ -511,7 +511,7 @@
-
+
The value of this keyword MUST be an array. Elements of this array, if any, MUST be strings, and MUST be unique. diff --git a/meta/validation.json b/meta/validation.json index c8e8f55d..8ff98638 100644 --- a/meta/validation.json +++ b/meta/validation.json @@ -61,7 +61,7 @@ "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" }, "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, "required": { "$ref": "#/$defs/stringArray" }, - "allRequiredExcept": { "$ref": "#/$defs/stringArray" }, + "requireAllExcept": { "$ref": "#/$defs/stringArray" }, "dependentRequired": { "type": "object", "additionalProperties": { From 37eacba6061a524f5be54cf9660dade54d675908 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Sun, 26 Jun 2022 13:26:28 -0700 Subject: [PATCH 8/8] Fix markup error --- jsonschema-validation.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index 82d8a4c6..a5b8e34d 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -225,7 +225,11 @@ "requireAllExcept", whose behavior is defined in terms of "properties" + + "minContains", whose behavior is defined in terms of "contains" + + "maxContains", whose behavior is defined in terms of "contains"