From 8c4299941acd110c30a4e59a62c9ac79314f540e Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Tue, 11 May 2021 11:38:59 -0700 Subject: [PATCH 01/27] Clarify vocab specs needn't be formal or published. --- jsonschema-core.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index a93c377d..88561c39 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -399,6 +399,13 @@ of any vocabulary, there is no analogous mechanism to indicate individual keyword usage. + + A schema vocabulary can be defined by anything from an informal description + to a standards proposal, depending on the audience and interoperability + expectations. In particular, in order to facilitate vocabulary use within + non-public organizations, a vocabulary specification need not be published + outside of its scope of use. +
From 6a4183ef2d46d9c65aa0ea56a2e4003eddbca263 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Tue, 11 May 2021 10:28:30 -0700 Subject: [PATCH 02/27] Remove redundant meta-schema update process notes This is covered for the entire spec as section 8.1.3. Note that the validation spec also has this, but only once in that document, so nothing else needs deleting. --- jsonschema-core.xml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index a93c377d..c73f0ce1 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2061,13 +2061,6 @@ The current URI for the corresponding meta-schema is: . - - Updated vocabulary and meta-schema URIs MAY be published between - specification drafts in order to correct errors. Implementations - SHOULD consider URIs dated after this specification draft and - before the next to indicate the same syntax and semantics - as those listed here. -
Schema keywords typically operate independently, without @@ -2497,13 +2490,6 @@ The current URI for the corresponding meta-schema is: . - - Updated vocabulary and meta-schema URIs MAY be published between - specification drafts in order to correct errors. Implementations - SHOULD consider URIs dated after this specification draft and - before the next to indicate the same syntax and semantics - as those listed here. -
From 770e7f5f917bf7f6a9e10932cccb7e7f7ca7a7b2 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Tue, 9 Nov 2021 06:47:37 -0800 Subject: [PATCH 03/27] Clarify the origin of contentEncoding (#1117) It is related to MIME's Content-Transfer-Encoding, and not HTTP's Content-Encoding. --- jsonschema-validation.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index e12c6cd2..fb244a0a 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -964,7 +964,7 @@ If the instance value is a string, this property defines that the string - SHOULD be interpreted as binary data and decoded using the encoding + SHOULD be interpreted as encoded binary data and decoded using the encoding named by this property. @@ -972,7 +972,13 @@ Possible values indicating base 16, 32, and 64 encodings with several variations are listed in RFC 4648. Additionally, sections 6.7 and 6.8 of RFC 2045 provide - encodings used in MIME. As "base64" is defined in both RFCs, the definition + encodings used in MIME. This keyword is derived from MIME's + Content-Transfer-Encoding header, which was designed to map binary data + into ASCII characters. It is not related to HTTP's Content-Encoding header, + which is used for compressing HTTP request and response payloads. + + + As "base64" is defined in both RFCs, the definition from RFC 4648 SHOULD be assumed unless the string is specifically intended for use in a MIME context. Note that all of these encodings result in strings consisting only of 7-bit ASCII characters. Therefore, this keyword From 8eb04a8b5ef1bea4099eb02e4451f2fe863fc223 Mon Sep 17 00:00:00 2001 From: Roberto Polli Date: Fri, 19 Nov 2021 16:43:58 +0100 Subject: [PATCH 04/27] Nitpick content-encoding. See #1100 (#1150) * Nitpick content-encoding. See #1100 * Update jsonschema-validation.xml --- jsonschema-validation.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index fb244a0a..9abdc1de 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -975,7 +975,8 @@ encodings used in MIME. This keyword is derived from MIME's Content-Transfer-Encoding header, which was designed to map binary data into ASCII characters. It is not related to HTTP's Content-Encoding header, - which is used for compressing HTTP request and response payloads. + which is used to encode (e.g. compress or encrypt) + the content of HTTP request and responses. As "base64" is defined in both RFCs, the definition From 0f43deb5a6ab9f32383bf33f7fbee390569f7377 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Thu, 30 Dec 2021 14:24:48 -0400 Subject: [PATCH 05/27] Add missing closing curly brace to D.2. example We also remove the trailing comma. See: https://github.com/json-schema-org/json-schema-spec/pull/1162 Signed-off-by: Juan Cruz Viotti --- jsonschema-core.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 49df09c2..c38ff1c8 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -3672,7 +3672,7 @@ https://example.com/schemas/common#/$defs/count/minimum {"$ref": "https://json-schema.org/draft/2020-12/meta/core"}, {"$ref": "https://json-schema.org/draft/2020-12/meta/applicator"}, {"$ref": "https://json-schema.org/draft/2020-12/meta/validation"}, - {"$ref": "https://example.com/meta/example-vocab", + {"$ref": "https://example.com/meta/example-vocab"} ], "patternProperties": { "^unevaluated": false From e0c6563aeb3e9605f9326ad1dd2961de2ec6b742 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Mon, 31 May 2021 14:30:11 -0700 Subject: [PATCH 06/27] mention that annotations from these keywords affect unevaluated* --- jsonschema-core.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index c38ff1c8..28f24051 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2318,6 +2318,8 @@ 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 @@ -2354,6 +2356,8 @@ the subschema validates successfully when applied to every index of the instance. The annotation MUST be present if the instance array to which this keyword's schema applies is empty. + This annotation affects the behavior of "unevaluatedItems" in the + Unevaluated vocabulary.
@@ -2373,6 +2377,8 @@ 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 @@ -2396,6 +2402,8 @@ 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 @@ -2422,6 +2430,8 @@ 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 @@ -2552,6 +2562,7 @@ positions within the instance array, it produces an annotation result of boolean true, analogous to the behavior of "items". + This annotation affects the behavior of "unevaluatedItems" in parent schemas. Omitting this keyword has the same assertion behavior as @@ -2595,6 +2606,7 @@ 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 parent schemas. Omitting this keyword has the same assertion behavior as From cff5ac196b8092365c27d515663f9cf19095eda2 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Mon, 31 May 2021 14:37:53 -0700 Subject: [PATCH 07/27] remove uses of "production" when discussing format rules RFC3339 refers to these as "formats". The XML xs:NCName specification refers to it as a "type". We are tying our implementation to the ABNF rules explicitly, so refer to those. --- jsonschema-validation.xml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index 9abdc1de..f1c5721c 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -704,30 +704,34 @@ A string instance is valid against this attribute if it is - a valid representation according to the "date-time" production. + a valid representation according to the "date-time' ABNF rule + (referenced above) A string instance is valid against this attribute if it is - a valid representation according to the "full-date" production. + a valid representation according to the "full-date" ABNF rule + (referenced above) A string instance is valid against this attribute if it is - a valid representation according to the "full-time" production. + a valid representation according to the "full-time" ABNF rule + (referenced above) A string instance is valid against this attribute if it is - a valid representation according to the "duration" production. + a valid representation according to the "duration" ABNF rule + (referenced above) Implementations MAY support additional attributes using the other - production names defined anywhere in that RFC. If "full-date" or "full-time" + format names defined anywhere in that RFC. If "full-date" or "full-time" are implemented, the corresponding short form ("date" or "time" respectively) MUST be implemented, and MUST behave identically. Implementations SHOULD NOT define extension attributes - with any name matching an RFC 3339 production unless it validates - according to the rules of that production. + with any name matching an RFC 3339 format unless it validates + according to the rules of that format. There is not currently consensus on the need for supporting all RFC 3339 formats, so this approach of reserving the From 44f5b82735da88ad51929a4350dea456d6fadf40 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Mon, 31 May 2021 14:52:43 -0700 Subject: [PATCH 08/27] rewording of sections on "contains", "maxContains", "minContains" - More cross-references added that note the dependence of these keywords on each other - Confusing paragraph about logical results removed (and it is redundant with other paragraphs) --- jsonschema-core.xml | 26 +++++++++++++++----------- jsonschema-validation.xml | 5 +++-- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 28f24051..f968c8cb 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2085,7 +2085,8 @@ "items", whose behavior is defined in terms of "prefixItems" - "contains", whose behavior is defined in terms of "minContains" + "contains", whose behavior is affected by the presence and value of + "minContains", in the Validation vocabulary @@ -2339,15 +2340,10 @@ An array instance is valid against "contains" if at least one of - its elements is valid against the given schema. 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. - - - Logically, the validation result of applying the value subschema to each - item in the array MUST be ORed with "false", resulting in an overall - validation result. + 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 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 @@ -2356,8 +2352,16 @@ the subschema validates successfully when applied to every index of the instance. The annotation MUST be present if the instance array to which this keyword's schema applies is empty. + + This annotation affects the behavior of "unevaluatedItems" in the - Unevaluated vocabulary. + Unevaluated vocabulary, and MAY also be used to implement the + "minContains" and "maxContains" keywords in the Validation vocabulary. + + + 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.
diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index f1c5721c..d92a5495 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -442,8 +442,9 @@ A value of 0 is allowed, but is only useful for setting a range - of occurrences from 0 to the value of "maxContains". A value of - 0 with no "maxContains" causes "contains" to always pass validation. + of occurrences from 0 to the value of "maxContains". A value of + 0 causes "minContains" to always pass validation (but validation can + still fail against a "maxContains" keyword). Omitting this keyword has the same behavior as a value of 1. From 53736b4843da17e3b6df5eb23450d935ef1af694 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Mon, 31 May 2021 16:25:40 -0700 Subject: [PATCH 09/27] "contains" did not annotate before 2020-12 --- jsonschema-core.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index f968c8cb..0137a711 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -3855,7 +3855,7 @@ https://example.com/schemas/common#/$defs/count/minimum "$schema" MAY change for embedded resources Array-value "items" functionality is now "prefixItems" "items" subsumes the old function of "additionalItems" - "contains" and "unevaluatedItems" interactions now specified + "contains" annotation behavior, and "contains" and "unevaluatedItems" interactions now specified Rename $recursive* to $dynamic* $dynamicAnchor defines a fragment like $anchor $dynamic* (previously $recursive) no longer use runtime base URI determination From 48736f785eb0ed84d66f8045296a0d6008db59d8 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Mon, 31 May 2021 16:26:03 -0700 Subject: [PATCH 10/27] $recursiveRef -> $dynamicRef was not just a simple keyword renaming --- jsonschema-core.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 0137a711..62d9b13d 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -3856,7 +3856,7 @@ https://example.com/schemas/common#/$defs/count/minimum Array-value "items" functionality is now "prefixItems" "items" subsumes the old function of "additionalItems" "contains" annotation behavior, and "contains" and "unevaluatedItems" interactions now specified - Rename $recursive* to $dynamic* + Rename $recursive* to $dynamic*, with behavior modification $dynamicAnchor defines a fragment like $anchor $dynamic* (previously $recursive) no longer use runtime base URI determination Define Compound Schema Documents (bundle) and processing From 6853f304a6dbe8097d25b51f466144e069d415cc Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Thu, 3 Feb 2022 20:14:32 -0800 Subject: [PATCH 11/27] improve wording Co-authored-by: Ben Hutton --- jsonschema-core.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 62d9b13d..afb0c775 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2342,7 +2342,7 @@ 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 valid against the "contains" keyword, + case an array instance MUST be considered valid against the "contains" keyword, even if NONE of its elements is valid against the given schema. From 8d597649cebd3649a04c3e69921a29e079db9738 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Thu, 3 Feb 2022 20:15:28 -0800 Subject: [PATCH 12/27] no shouty --- jsonschema-core.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index afb0c775..104335fd 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2343,7 +2343,7 @@ 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. + even if none of its elements is valid against the given schema. This keyword produces an annotation value which is an array of From 371dae1577de24884a91059290787751c20b466e Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Thu, 3 Feb 2022 10:31:07 -0800 Subject: [PATCH 13/27] Remove remaining media-type param references --- jsonschema-core.xml | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 104335fd..8233bee3 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -3130,20 +3130,6 @@ https://example.com/schemas/common#/$defs/count/minimum Type name: application Subtype name: schema+json Required parameters: N/A - - Optional parameters: - - - A non-empty list of space-separated URIs, each identifying - a JSON Schema resource. The instance SHOULD successfully - validate against at least one of these meta-schemas. - Non-validating meta-schemas MAY be included for purposes such - as allowing clients to make use of older versions of - a meta-schema as long as the runtime instance validates - against that older version. - - - Encoding considerations: Encoding considerations are identical to those specified for the "application/json" @@ -3174,20 +3160,7 @@ https://example.com/schemas/common#/$defs/count/minimum Type name: application Subtype name: schema-instance+json - - Required parameters: - - - A non-empty list of space-separated URIs, each identifying - a JSON Schema resource. The instance SHOULD successfully - validate against at least one of these schemas. - Non-validating schemas MAY be included for purposes such - as allowing clients to make use of older versions of a schema - as long as the runtime instance validates against that - older version. - - - + Required parameters: N/A Encoding considerations: Encoding considerations are identical to those specified for the "application/json" From db65da82ce72886ae9fd01727db9a25a422b4652 Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Mon, 14 Mar 2022 11:10:38 +0000 Subject: [PATCH 14/27] Clarify that plain name fragments are neither canonical or non-canonical (#1192) * Clarify that plain name fragments are neither canonical or non-canonical Attempt to resolve #937 Add note and cref in appendix A clarifying that we intended to define a URI phrasing which would avoid the requirement to allow for location shadowing in implementations, as this is tricky. Clarifying that plain name fragments should always be supported, and that they only can work in relation to the base URI of the Schema Resource. Otherwise there could be duplicate plain name fragments and addressing wouldn't work. --- jsonschema-core.xml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 8233bee3..07b9436e 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -50,7 +50,7 @@ - + Internet Engineering Task Force JSON Schema @@ -1824,10 +1824,10 @@ reference target, is preferable. - An implementation MAY choose not to support addressing schemas - by non-canonical URIs. As such, it is RECOMMENDED that schema authors only - use canonical URIs, as using non-canonical URIs may reduce - schema interoperability. + An implementation MAY choose not to support addressing schema resources + (and their subschemas) by non-canonical URIs. + As such, it is RECOMMENDED that schema authors only use canonical URIs, + as using non-canonical URIs may reduce schema interoperability. This is to avoid requiring implementations to keep track of a whole stack of possible base URIs and JSON Pointer fragments for each, @@ -1836,6 +1836,11 @@ no point in forbidding it, while others have argued that it complicates schema identification and should be forbidden. Feedback on this topic is encouraged. + After some discussion, we feel that we need to remove the use of + "canonical" in favour of talking about JSON Pointers which reference + across schema resource boundaries as undefined or even forbidden behavior + (https://github.com/json-schema-org/json-schema-spec/issues/937, + https://github.com/json-schema-org/json-schema-spec/issues/1183) @@ -3390,6 +3395,18 @@ https://example.com/schemas/common#/$defs/count/minimum + + Note: The fragment part of the URI does not make it canonical or non-canonical, + rather, the base URI used (as part of the full URI with any fragment) is what + determines the canonical nature of the resulting full URI. + + Multiple "canonical" URIs? We Acknowledge this is potentially confusing, and + direct you to read the CREF located in the + JSON Pointer fragments and embedded schema resources + section for futher comments. + + +
From 4f9e8bed0157fdf57dd850fdc4939a3f56d949d0 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Thu, 13 May 2021 17:18:58 -0700 Subject: [PATCH 15/27] Clarify various things about canonical URIs Fixes issue #937, clarifying a number of other things along the way. While it touches a fair number of lines, I'm fairly sure that it doesn't anything about conformance. After spending more time reading various writings on the concept of the "canonical" URI for a resource, and reviewing our language, I came to the following conclusions: * canonical URIs only make sense at the whole-resource scope * A URI with a fragment is neither canonical nor non-canonical * It makes more sense to talk about fragments w.r.t. canonical URIs * Our language was sufficiently confusing that going this way seems fine. As part of this, I fixed an outright incorrect statement that identifier keywords set canonical URIs. Since there is only one canonical URI and a single schema object could contain three ($id, $anchor, $dynamicAnchor) or more identifier keywords, this statement is clearly a bug. These keywords assign URIs, but only $id assigns a canonical one. I revamped a lot of wording in descriptions and examples to hopefully be more precise. I separated the discussion of the empty fragment in $id from the main paragraph of its functionality, and clarified that this is talking about a media-type-specific semantic equivalence, and is not asserting that RFC 3986 normalization applies to fragments (this has been a point of confusion). --- jsonschema-core.xml | 144 ++++++++++++++++++++++++-------------------- 1 file changed, 79 insertions(+), 65 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 07b9436e..058219aa 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -315,8 +315,8 @@ of five categories: - control schema identification through setting the schema's - canonical URI and/or changing how the base URI is determined + control schema identification through setting a URI + for the schema and/or changing how the base URI is determined produce a boolean result when applied to an instance @@ -426,7 +426,9 @@ A JSON Schema resource is a schema which is canonically identified by an - absolute URI. + absolute URI. Schema resources MAY + also be identified by URIs including fragments. Any such URIs + are considered to be non-canonical. The root schema is the schema that comprises the entire JSON document @@ -730,9 +732,9 @@ be able to support those keywords or vocabularies that contain them.
-
+
- Identifiers set the canonical URI of a schema, or affect how such URIs are + Identifiers define URIs for a schema, or affect how such URIs are resolved in references, or both. The Core vocabulary defined in this document defines several identifying keywords, most notably "$id". @@ -1340,26 +1342,31 @@ If present, the value for this keyword MUST be a string, and MUST represent a valid URI-reference. This URI-reference - SHOULD be normalized, and MUST resolve to an - absolute-URI (without a fragment). Therefore, - "$id" MUST NOT contain a non-empty fragment, and SHOULD NOT contain an - empty fragment. + SHOULD be normalized, and MUST be semantically equivalent to an + absolute-URI (without a fragment). - Since an empty fragment in the context of the application/schema+json media - type refers to the same resource as the base URI without a fragment, - an implementation MAY normalize a URI ending with an empty fragment by removing - the fragment. However, schema authors SHOULD NOT rely on this behavior - across implementations. + The application/schema+json media type defines that an absolute-URI + identifying a resource and the same URI with an empty fragment + appended (which identifies the resource's root schema object) are + semantically equivalent. Since this semantic equivalence is not part + of the RFC 3986 normalization process, + implementors and schema authors cannot rely on generic URI libraries + understanding the equivalence. + + + Therefore, "$id" MUST NOT contain a non-empty fragment, and SHOULD NOT + contain an empty fragment. The absolute-URI form MUST be considered + the canonical URI, regardless of the presence or absence of an empty fragment. - This is primarily allowed because older meta-schemas have an empty - fragment in their $id (or previously, id). A future draft may outright - forbid even empty fragments in "$id". + An empty fragment is currently allowed because older meta-schemas have + an empty fragment in their $id (or previously, id). + A future draft may outright forbid even empty fragments in "$id". - This URI also serves as the base URI for relative URI-references in keywords - within the schema resource, in accordance with + The absolute-URI also serves as the base URI for relative URI-references + in keywords within the schema resource, in accordance with RFC 3986 section 5.1.1 regarding base URIs embedded in content. @@ -1623,7 +1630,7 @@ media type. - Unless the "$id" keyword described in the next section is present in the + Unless the "$id" keyword described in an earlier section is present in the root schema, this base URI SHOULD be considered the canonical URI of the schema document's root schema resource. @@ -1750,7 +1757,7 @@ Since JSON Pointer URI fragments are constructed based on the structure of the schema document, an embedded schema resource and its subschemas can be identified by JSON Pointer fragments relative to either its own - canonical URI, or relative to the containing resource's URI. + canonical URI, or relative to a containing resource's URI. Conceptually, a set of linked schema resources should behave @@ -1782,13 +1789,18 @@ } ]]> - - The URI "https://example.com/foo#/items/additionalProperties" - points to the schema of the "additionalProperties" keyword in - the embedded resource. The canonical URI of that schema, however, - is "https://example.com/bar#/additionalProperties". - + + The URI "https://example.com/foo#/items" points to the "items" schema, + which is an embedded resource. The canonical URI of that schema + resource, however, is "https://example.com/bar". + + + For the "additionalProperties" schema within that embedded resource, + the URI "https://example.com/foo#/items/additionalProperties" points + to the correct object, but that object's URI relative to its resource's + canonical URI is "https://example.com/bar#/additionalProperties". +
Now consider the following two schema resources linked by reference @@ -1810,29 +1822,31 @@ ]]> - Here we see that the canonical URI for that "additionalProperties" - subschema is still valid, while the non-canonical URI with the fragment - beginning with "#/items/$ref" now resolves to nothing. + Here we see that the URI for the "additionalProperties" schema object + that is relative to its resource's canonical URI is still valid, + while the URI relative to the "items" schema object's URI no longer + resolves to anything.
Note also that "https://example.com/foo#/items" is valid in both arrangements, but resolves to a different value. This URI ends up - functioning similarly to a retrieval URI for a resource. While valid, - examining the resolved value and either using the "$id" (if the value - is a subschema), or resolving the reference and using the "$id" of the - reference target, is preferable. + functioning similarly to a retrieval URI for a resource. While this URI + is valid, it is more robust to use the "$id" of the embedded or referenced + resource unless it is specifically desired to identify the object containing + the "$ref" in the second (non-embedded) arrangement. - An implementation MAY choose not to support addressing schema resources - (and their subschemas) by non-canonical URIs. - As such, it is RECOMMENDED that schema authors only use canonical URIs, - as using non-canonical URIs may reduce schema interoperability. + An implementation MAY choose not to support addressing schema resource + contents by URIs using a base other than the resource's canonical URI, + plus a JSON Pointer fragment relative to that base. Therefore, schema + authors SHOULD NOT rely on such URIs, as using them may reduce interoperability. This is to avoid requiring implementations to keep track of a whole stack of possible base URIs and JSON Pointer fragments for each, given that all but one will be fragile if the schema resources - are reorganized. Some have argued that this is easy so there is + are reorganized. Some + have argued that this is easy so there is no point in forbidding it, while others have argued that it complicates schema identification and should be forbidden. Feedback on this topic is encouraged. @@ -1844,9 +1858,9 @@ - Further examples of such non-canonical URIs, as well as the appropriate - canonical URIs to use instead, are provided in appendix - . + Further examples of such non-canonical URI construction, as well as + the appropriate canonical URI-based fragments to use instead, + are provided in appendix .
@@ -2709,8 +2723,8 @@
The absolute, dereferenced location of the validating keyword. The value MUST - be expressed as a full URI using the canonical URI of the relevant - schema object, and it MUST NOT include by-reference applicators + be expressed as a full URI using the canonical URI of the relevant schema resource + with a JSON Pointer fragment, and it MUST NOT include by-reference applicators such as "$ref" or "$dynamicRef" as non-terminal path components. It MAY end in such keywords if the error or annotation is for that keyword, such as an unresolvable reference. @@ -3319,10 +3333,10 @@ https://example.com/schemas/common#/$defs/count/minimum - + https://example.com/root.json - + https://example.com/root.json# @@ -3330,21 +3344,21 @@ https://example.com/schemas/common#/$defs/count/minimum https://example.com/root.json - + https://example.com/root.json#foo - + https://example.com/root.json#/$defs/A - https://example.com/other.json - + https://example.com/other.json + https://example.com/other.json# - + https://example.com/root.json#/$defs/B @@ -3352,43 +3366,43 @@ https://example.com/schemas/common#/$defs/count/minimum https://example.com/other.json - + https://example.com/other.json#bar - + https://example.com/other.json#/$defs/X - + https://example.com/root.json#/$defs/B/$defs/X - https://example.com/t/inner.json - + https://example.com/t/inner.json + https://example.com/t/inner.json#bar - + https://example.com/t/inner.json# - + https://example.com/other.json#/$defs/Y - + https://example.com/root.json#/$defs/B/$defs/Y - + urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f - + urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f# - + https://example.com/root.json#/$defs/C @@ -3432,8 +3446,8 @@ https://example.com/schemas/common#/$defs/count/minimum This transformation can be safely and reversibly done as long as all static references (e.g. "$ref") use URI-references that resolve - to canonical URIs, and all schema resources have an absolute-URI - as the "$id" in their root schema. + to URIs using the canonical resource URI as the base, and all schema + resources have an absolute-URI as the "$id" in their root schema. With these conditions met, each external resource can be copied @@ -3441,7 +3455,7 @@ https://example.com/schemas/common#/$defs/count/minimum schema objects, and without changing any aspect of validation or annotation results. The names of the schemas under "$defs" do not affect behavior, assuming they are each unique, as they - do not appear in canonical URIs for the embedded resources. + do not appear in the canonical URIs for the embedded resources.
From afca53d622aad3ce646917e2bd764f612c544806 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Tue, 13 Jul 2021 16:47:56 -0700 Subject: [PATCH 16/27] Update based on review feedback. --- jsonschema-core.xml | 46 +++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 058219aa..00738358 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -427,14 +427,24 @@ A JSON Schema resource is a schema which is canonically identified by an absolute URI. Schema resources MAY - also be identified by URIs including fragments. Any such URIs - are considered to be non-canonical. + also be identified by URIs, including URIs with fragments, + if the resulting secondary resource (as defined by + section 3.5 of RFC 3986) is identical + to the primary resource. This can occur with the empty fragment, + or when one schema resource is embedded in another. Any such URIs + with fragments are considered to be non-canonical. The root schema is the schema that comprises the entire JSON document in question. The root schema is always a schema resource, where the URI is determined as described in section . + + Note that documents that embed schemas in another format will not + have a root schema resource in this sense. Exactly how such usages + fit with the JSON Schema document and resource concepts will be + clarified in a future draft. + Some keywords take schemas themselves, allowing JSON Schemas to be nested: @@ -1342,17 +1352,19 @@ If present, the value for this keyword MUST be a string, and MUST represent a valid URI-reference. This URI-reference - SHOULD be normalized, and MUST be semantically equivalent to an - absolute-URI (without a fragment). + SHOULD be normalized, and MUST resolve to an + absolute-URI (without a fragment), + or to a URI with an empty fragment. - The application/schema+json media type defines that an absolute-URI - identifying a resource and the same URI with an empty fragment - appended (which identifies the resource's root schema object) are - semantically equivalent. Since this semantic equivalence is not part - of the RFC 3986 normalization process, - implementors and schema authors cannot rely on generic URI libraries - understanding the equivalence. + The empty fragment form is NOT RECOMMENDED and is retained only + for backwards compatibility, and because the + application/schema+json media type defines that a URI with an + empty fragment identifies the same resource as the same URI + with the fragment removed. However, since this equivalence is not + part of the RFC 3986 normalization process, + implementers and schema authors cannot rely on generic URI libraries + understanding it. Therefore, "$id" MUST NOT contain a non-empty fragment, and SHOULD NOT @@ -1757,7 +1769,7 @@ Since JSON Pointer URI fragments are constructed based on the structure of the schema document, an embedded schema resource and its subschemas can be identified by JSON Pointer fragments relative to either its own - canonical URI, or relative to a containing resource's URI. + canonical URI, or relative to any containing resource's URI. Conceptually, a set of linked schema resources should behave @@ -1822,10 +1834,12 @@ ]]> - Here we see that the URI for the "additionalProperties" schema object - that is relative to its resource's canonical URI is still valid, - while the URI relative to the "items" schema object's URI no longer - resolves to anything. + Here we see that "https://example.com/bar#/additionalProperties", + using a JSON Pointer fragment appended to the canonical URI of + the "bar" schema resource, is still valid, while + "https://example.com/foo#/items/additionalProperties", which relied + on a JSON Pointer fragment appended to the canonical URI of the + "foo" schema resource, no longer resolves to anything. From c186b9a5b37e8a26d7e0ed4faa796d76a3005e26 Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Wed, 30 Mar 2022 09:46:52 +0100 Subject: [PATCH 17/27] Add CREF about ambiguous behaviour of additionalProperties Fixes #1172 Must see new issue relating to the behaviour of annotation collection for resolving in the next draft. --- jsonschema-core.xml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 00738358..5622cc38 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2480,6 +2480,28 @@ checking the names in "properties" and the patterns in "patternProperties" against the instance property set. Implementations that do not support annotation collection MUST do so. + + In defining this option, it seems there is the potential for + ambiguity in the output format. The ambiguity does not affect validation results, + but it does affect the resulting output format. + The ambiguity allows for multiple valid output results depending on whether annotations + are used or a solution that "produces the same effect" as draft-07. It is understood + that annotations from failing schemas are dropped. See + https://github.com/json-schema-org/community/discussions/57 for details. + We discussed the possible solutions at length (https://github.com/json-schema-org/json-schema-spec/issues/1172). + We concluded that we need to re-evaluate the annotation collection system + and its use for validation purposes, but we also agreed not to do so for this release. + This confusion stemmed from the understanding of "evaluated" and the impact on + annotation collection. + It was proposed that we could read a different interpretation (https://github.com/json-schema-org/json-schema-spec/issues/1172#issuecomment-1049686478) + however the previous interpretation is still valid. + The only consensus we could reach for this release was to note all this + in a CREF, which you're now reading, and acknowledge that both results + as described in https://github.com/json-schema-org/community/discussions/57. + If you encounter the same issue regarding ambiguity of the output format, + please do reach out to us, either via emails as per editors of this specification, + or other official JSON Schema channels like our Slack or Twitter. +
From f13350a971899eb4893383e729680a91b9428880 Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Fri, 8 Apr 2022 15:53:07 +0100 Subject: [PATCH 18/27] Remove detail about ambiguity and reasoning. Link out to pending ADR --- jsonschema-core.xml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 5622cc38..b4e2efa2 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2486,21 +2486,10 @@ but it does affect the resulting output format. The ambiguity allows for multiple valid output results depending on whether annotations are used or a solution that "produces the same effect" as draft-07. It is understood - that annotations from failing schemas are dropped. See - https://github.com/json-schema-org/community/discussions/57 for details. - We discussed the possible solutions at length (https://github.com/json-schema-org/json-schema-spec/issues/1172). - We concluded that we need to re-evaluate the annotation collection system - and its use for validation purposes, but we also agreed not to do so for this release. - This confusion stemmed from the understanding of "evaluated" and the impact on - annotation collection. - It was proposed that we could read a different interpretation (https://github.com/json-schema-org/json-schema-spec/issues/1172#issuecomment-1049686478) - however the previous interpretation is still valid. - The only consensus we could reach for this release was to note all this - in a CREF, which you're now reading, and acknowledge that both results - as described in https://github.com/json-schema-org/community/discussions/57. - If you encounter the same issue regarding ambiguity of the output format, - please do reach out to us, either via emails as per editors of this specification, - or other official JSON Schema channels like our Slack or Twitter. + that annotations from failing schemas are dropped. + See our + [Decision Record](https://github.com/json-schema-org/json-schema-spec/tree/HEAD/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md) + for further details.
From e8a602877264001f9b11de3f81755747922811ae Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Fri, 8 Apr 2022 16:00:19 +0100 Subject: [PATCH 19/27] Add folder for architectural decision records (ADRs) Add first spec related ADR about the handling of additionalProperties ambiguity in 2019-09 and 2020-12 for the patch release by adding a CREF --- ...iguity-and-fix-later-gh-spec-issue-1172.md | 87 +++++++++++++++++++ adr/README.md | 15 ++++ adr/template.md | 72 +++++++++++++++ 3 files changed, 174 insertions(+) create mode 100644 adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md create mode 100644 adr/README.md create mode 100644 adr/template.md diff --git a/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md b/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md new file mode 100644 index 00000000..cd7fb61d --- /dev/null +++ b/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md @@ -0,0 +1,87 @@ +# Acknowledge ambiguity in additionalProperties behaviour and fix after patch release + +* Status: proposed +* Deciders: @relequestual @gregsdennis, @jdesrosiers, @karenetheridge +* Date: 2022-04-08 + +https://github.com/json-schema-org/json-schema-spec/issues/1172 +https://github.com/json-schema-org/community/discussions/57 +https://github.com/json-schema-org/json-schema-spec/pull/1203 + +## Context and Problem Statement + +When we changed the specification to use annotations as the context in which some keywords behave, we included a clause that implementations which didn't use annotations may implement or optimize the processing of `additionalProperties` in another way which produces the same effect as the prior behaviour. +This section created an ambiguity in terms of the resulting output format, but not validation. + +We needed to decide on how to proceed for the patch release of the 2020-12 version of the specification. + +The two above links are to a GitHub Discussion and a GitHub Issue detailing the problems. +Details with an example of the problem can be seen in the Discussion's opening post specifically. + +## Decision Drivers + +* The "patch release" should not change anything functionally +* Annotations as they are, are confusing to users, implementers, and specification editors alike +* Patch release is behind schedule +* There are currently no tests for the output format +* It's hard to see any immediate consensus on changing the annotation based behaviour + +## Considered Options + +* [Leaving it "as is" and do nothing](https://github.com/json-schema-org/community/discussions/57#discussioncomment-1413777) +* [Pick one](https://github.com/json-schema-org/community/discussions/57#discussioncomment-1416683) of the behaviours +* [Revert back to draft-07 behaviour](https://github.com/json-schema-org/community/discussions/57#discussioncomment-1453723) +* [Reinterpret how we understand annotation collection](https://github.com/json-schema-org/json-schema-spec/issues/1172#issuecomment-1049686478) to allow reading annotations within the same schema object regardless of assertion results +* [Acknowledge and accept that two approaches and results are allowable](https://github.com/json-schema-org/community/issues/161#issue-1173742930) +* Redefine annotation collection behaviour and/or how `additionalProperties` works + +## Decision Outcome + +Chosen option: "Acknowledge and accept that two approaches and results are allowable", because + +* Leaving it "as is" will continue to cause confusion +* The change is non-functional which is required for the patch release +* The patch release is behind schedule +* Finding consensus of other solutions proved to be difficult +* There's no test suite for the output format, so it's not easy to see unintended consequences of a functional change +* We need to properly re-evaluate annotation collection and how annotations are used by other keywords + +### Positive Consequences + +* Patch release can move forward +* Validation result is not impacted +* Confusion is at least seen and acknowledged +* Implementations which pick either approach are seen to be compliant + +### Negative Consequences + +* May have an impact for downstream tools which process full output data +* A test suite (not yet developed) which covers this situation needs to allow for multiple valid answers + +## Pros and Cons of the Options + +### Leaving it "as is" and do nothing + +Agree to do nothing and hope for the best. There isn't any downstream tooling yet anyway. + +* Good, because no functional change +* Good, because no impact on downstream tooling +* Bad, because leaves a known ambiguity in the specification + +### Pick one / Revert to draft-07 behaviour / Reinterpret annotation collection + +* Good, because ambiguity is removed +* Good, because not many tools will be effected +* Bad, because it can be seen as a functional change (not really allowed for the patch release) +* Bad, because it can break existing implementations and downstream tools +* Bad, because without a test suite it's hard to see unexpected consequences + +## Links + +* Issue: [Ambiguous behaviour of additionalProperties when invalid](https://github.com/json-schema-org/json-schema-spec/issues/1172) +* Discussion: [The meaning of "additionalProperties" has changed](https://github.com/json-schema-org/community/discussions/57) +* Resolving Pull Request: [Add CREF about ambiguous behaviour of additionalProperties](https://github.com/json-schema-org/json-schema-spec/pull/1203) +* Alternative solution proposal: [Resolve contradictions in the described behaviour of "additionalProperties" and "items"](https://github.com/json-schema-org/json-schema-spec/pull/1154) + +* [Result of discussing](https://github.com/json-schema-org/json-schema-spec/issues/1172#issuecomment-1063962900) on an Open Community Working Meeting call - @jdesrosiers proposed a less controversial and more agreeable solution to add a comment that both are allowable +* [Related GitHub Discussion](https://github.com/json-schema-org/community/discussions/67) on alternative behaviour for `unevaluated*` keywords diff --git a/adr/README.md b/adr/README.md new file mode 100644 index 00000000..331cd6bf --- /dev/null +++ b/adr/README.md @@ -0,0 +1,15 @@ +# Architectural Decision Log + +This log lists the architectural decisions for the JSON Schema specification. + + + +* [ADR-2022-04-08](2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md) - Acknowledge ambiguity in additionalProperties behaviour and fix after patch release + + + +You can find the ADR for using ADRs in our [community repo ADR log](https://github.com/json-schema-org/community/tree/HEAD/docs/adr). + +For new ADRs, please use [template.md](template.md) as basis. +More information on MADR is available at . +General information about architectural decision records is available at . diff --git a/adr/template.md b/adr/template.md new file mode 100644 index 00000000..25696bbe --- /dev/null +++ b/adr/template.md @@ -0,0 +1,72 @@ +# [short title of solved problem and solution] + +* Status: [proposed | rejected | accepted | deprecated | … | superseded by [ADR-0005](0005-example.md)] +* Deciders: [list everyone involved in the decision] +* Date: [YYYY-MM-DD when the decision was last updated] + +Technical Story: [description | ticket/issue URL] + +## Context and Problem Statement + +[Describe the context and problem statement, e.g., in free form using two to three sentences. You may want to articulate the problem in form of a question.] + +## Decision Drivers + +* [driver 1, e.g., a force, facing concern, …] +* [driver 2, e.g., a force, facing concern, …] +* … + +## Considered Options + +* [option 1] +* [option 2] +* [option 3] +* … + +## Decision Outcome + +Chosen option: "[option 1]", because [justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force force | … | comes out best (see below)]. + +### Positive Consequences + +* [e.g., improvement of quality attribute satisfaction, follow-up decisions required, …] +* … + +### Negative Consequences + +* [e.g., compromising quality attribute, follow-up decisions required, …] +* … + +## Pros and Cons of the Options + +### [option 1] + +[example | description | pointer to more information | …] + +* Good, because [argument a] +* Good, because [argument b] +* Bad, because [argument c] +* … + +### [option 2] + +[example | description | pointer to more information | …] + +* Good, because [argument a] +* Good, because [argument b] +* Bad, because [argument c] +* … + +### [option 3] + +[example | description | pointer to more information | …] + +* Good, because [argument a] +* Good, because [argument b] +* Bad, because [argument c] +* … + +## Links + +* [Link type] [Link to ADR] +* … From 26bfeb8a9c753c8f2b02a8d9f19f7220960838be Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Wed, 20 Apr 2022 10:16:38 +0100 Subject: [PATCH 20/27] Tidy initial links in an ADR --- ...ref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md b/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md index cd7fb61d..f4fab086 100644 --- a/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md +++ b/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md @@ -4,9 +4,12 @@ * Deciders: @relequestual @gregsdennis, @jdesrosiers, @karenetheridge * Date: 2022-04-08 -https://github.com/json-schema-org/json-schema-spec/issues/1172 -https://github.com/json-schema-org/community/discussions/57 -https://github.com/json-schema-org/json-schema-spec/pull/1203 +Related... +Issue: https://github.com/json-schema-org/json-schema-spec/issues/1172 + +Discussion: https://github.com/json-schema-org/community/discussions/57 + +Pull Request: https://github.com/json-schema-org/json-schema-spec/pull/1203 ## Context and Problem Statement From 74a4e7ede7522074974556d65a2f26360a576ae9 Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Wed, 20 Apr 2022 10:16:52 +0100 Subject: [PATCH 21/27] Further tidy --- ...-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md | 1 + 1 file changed, 1 insertion(+) diff --git a/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md b/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md index f4fab086..aee552e4 100644 --- a/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md +++ b/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md @@ -5,6 +5,7 @@ * Date: 2022-04-08 Related... + Issue: https://github.com/json-schema-org/json-schema-spec/issues/1172 Discussion: https://github.com/json-schema-org/community/discussions/57 From 98e3ee7756ea9e0c3b22b2ea5f23e7a804e8cd91 Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Thu, 28 Apr 2022 13:30:21 +0100 Subject: [PATCH 22/27] Change date of validation spec to 2022. Year has to be current or xml2rfc says no. --- jsonschema-validation.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index d92a5495..ad005c07 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -53,7 +53,7 @@ - + Internet Engineering Task Force JSON Schema From 56ebcd09302714ddfaafa212fa764b9b1a1e2714 Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Thu, 28 Apr 2022 16:54:33 +0100 Subject: [PATCH 23/27] Update draft identifiers for 2020-12 patch release --- jsonschema-core.xml | 6 +++--- jsonschema-validation.xml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index b4e2efa2..a9604a2f 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -20,7 +20,7 @@ - + JSON Schema: A Media Type for Describing JSON Documents @@ -3267,9 +3267,9 @@ https://example.com/schemas/common#/$defs/count/minimum - + - + diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index ad005c07..8c4820fb 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -28,7 +28,7 @@ - + JSON Schema Validation: A Vocabulary for Structural Validation of JSON @@ -1354,9 +1354,9 @@ <author initials="G." surname="Dennis"> <organization/> </author> - <date year="2020" month="December"/> + <date year="2022" month="May"/> </front> - <seriesInfo name="Internet-Draft" value="draft-bhutton-json-schema-00" /> + <seriesInfo name="Internet-Draft" value="draft-bhutton-json-schema-01" /> </reference> </references> From 9afa06b1dfbfac5266ac79bf053e01512ef0d31c Mon Sep 17 00:00:00 2001 From: Ben Hutton <relequestual@gmail.com> Date: Tue, 10 May 2022 14:13:40 +0100 Subject: [PATCH 24/27] Changes ADR phrasing to improve readability --- ...04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md b/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md index aee552e4..03b976dc 100644 --- a/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md +++ b/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md @@ -14,7 +14,7 @@ Pull Request: https://github.com/json-schema-org/json-schema-spec/pull/1203 ## Context and Problem Statement -When we changed the specification to use annotations as the context in which some keywords behave, we included a clause that implementations which didn't use annotations may implement or optimize the processing of `additionalProperties` in another way which produces the same effect as the prior behaviour. +When we changed the specification to use annotations as the context in which some keywords behave, we included a clause that allowed implementations which didn't use annotations to optimize the processing of `additionalProperties` in another way which produces the same effect as the prior behaviour. This section created an ambiguity in terms of the resulting output format, but not validation. We needed to decide on how to proceed for the patch release of the 2020-12 version of the specification. From 859ca972a4bd66b005dab987d6f628a81ea873c7 Mon Sep 17 00:00:00 2001 From: Ben Hutton <relequestual@gmail.com> Date: Thu, 19 May 2022 12:06:35 +0100 Subject: [PATCH 25/27] Add changelog for 2020-12 patch 1 update Specifically draft-bhutton-json-schema-01 and draft-bhutton-json-schema-validation-01 --- jsonschema-core.xml | 10 ++++++++++ jsonschema-validation.xml | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index a9604a2f..d3beca54 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -3879,6 +3879,16 @@ https://example.com/schemas/common#/$defs/count/minimum </t> <t> <list style="hanging"> + <t hangText="draft-bhutton-json-schema-01"> + <list style="symbols"> + <t>Improve and clarify the "type", "contains", "unevaluatedProperties", and "unevaluatedItems" keyword explanations</t> + <t>Clarify various aspects of "canonical URIs"</t> + <t>Comment on ambiguity around annotations and "additionalProperties"</t> + <t>Clarify Vocabularies need not be formally defined</t> + <t>Remove references to remaining media-type parameters</t> + <t>Fix multiple examples</t> + </list> + </t> <t hangText="draft-bhutton-json-schema-00"> <list style="symbols"> <t>"$schema" MAY change for embedded resources</t> diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index 8c4820fb..fdc3d4a4 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -1441,6 +1441,12 @@ </t> <t> <list style="hanging"> + <t hangText="draft-bhutton-json-schema-validation-01"> + <list style="symbols"> + <t>Improve and clarify the "minContains" keyword explanation</t> + <t>Remove the use of "production" in favour of "ABNF rule"</t> + </list> + </t> <t hangText="draft-bhutton-json-schema-validation-00"> <list style="symbols"> <t>Correct email format RFC reference to 5321 instead of 5322</t> From 438866ebba372d15f6b0085d2999d8648d9f334e Mon Sep 17 00:00:00 2001 From: Ben Hutton <relequestual@gmail.com> Date: Thu, 19 May 2022 16:10:32 +0100 Subject: [PATCH 26/27] Updated ADR status to accepted and updated date to current, reflecting last updated --- ...-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md b/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md index 03b976dc..5e83dd95 100644 --- a/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md +++ b/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md @@ -1,8 +1,8 @@ # Acknowledge ambiguity in additionalProperties behaviour and fix after patch release -* Status: proposed +* Status: accepted * Deciders: @relequestual @gregsdennis, @jdesrosiers, @karenetheridge -* Date: 2022-04-08 +* Date: 2022-05-19 Related... From 4c8337713f343a9250fb68601ecd0b5382482ece Mon Sep 17 00:00:00 2001 From: Greg Dennis <gregsdennis@yahoo.com> Date: Thu, 26 May 2022 21:51:27 +1200 Subject: [PATCH 27/27] add clarification that minContains:0 also causes contains to pass --- jsonschema-validation.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index fdc3d4a4..ee3ee1b6 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -443,8 +443,8 @@ <t> A value of 0 is allowed, but is only useful for setting a range of occurrences from 0 to the value of "maxContains". A value of - 0 causes "minContains" to always pass validation (but validation can - still fail against a "maxContains" keyword). + 0 causes "minContains" and "contains" to always pass validation + (but validation can still fail against a "maxContains" keyword). </t> <t> Omitting this keyword has the same behavior as a value of 1.