From c636bd6a13ffc5ef9573a75acaa0a59642592dc5 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Wed, 8 Mar 2023 09:08:56 +1300 Subject: [PATCH 1/5] add section on explicit annotations; disallow unknown keywords --- jsonschema-core.xml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 61d9fff3..531c54dd 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -624,12 +624,22 @@ for registering and implementing such handlers is implementation-dependent. +
+ + The values of keywords which begin with the "@" symbol MUST be + collected as annotations. + + + Consequently, the "@" symbol is reserved for this purpose, and + extension vocabularies which define keywords that start with "@" + MUST define them as annotation-only keywords. + +
+
- Implementations SHOULD treat keywords they do not recognize, or that - they recognize but do not support, as annotations, where the value of - the keyword is the value of the annotation. Whether an implementation - collects these annotations or not, they MUST otherwise ignore the keywords. + Implementations MUST refuse to process schemas which contain + unrecognized or unsupported keywords.
From b88d95efd6b273fd938fa074b058ad4db5fe0e5d Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Wed, 8 Mar 2023 09:50:25 +1300 Subject: [PATCH 2/5] tweak to more closely match existing wording --- jsonschema-core.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 531c54dd..4da99ea5 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -639,7 +639,8 @@
Implementations MUST refuse to process schemas which contain - unrecognized or unsupported keywords. + keywords which they do not recognize or which they recognize + but do not support.
From 33c113ca3b5911949ab25c44b0553480bf4079ea Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Wed, 8 Mar 2023 10:18:09 +1300 Subject: [PATCH 3/5] revert unrecognized keywords change --- jsonschema-core.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 4da99ea5..fe81ed4a 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -638,9 +638,10 @@
- Implementations MUST refuse to process schemas which contain - keywords which they do not recognize or which they recognize - but do not support. + Implementations SHOULD treat keywords they do not recognize, or that + they recognize but do not support, as annotations, where the value of + the keyword is the value of the annotation. Whether an implementation + collects these annotations or not, they MUST otherwise ignore the keywords.
From 29ca11605522fef94e9147a34b3c2df047ff3026 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Fri, 17 Mar 2023 11:41:33 +1300 Subject: [PATCH 4/5] add 'annotation collection only' requirement --- jsonschema-core.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index fe81ed4a..cf5aa190 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -629,6 +629,10 @@ The values of keywords which begin with the "@" symbol MUST be collected as annotations. + + Keywords which begin with the "@" symbol MUST NOT affect evaluation + of a schema in any way other than annotation collection. + Consequently, the "@" symbol is reserved for this purpose, and extension vocabularies which define keywords that start with "@" From 01c8327de6bd294245659272a3133d30a53905ab Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 28 Mar 2023 18:08:55 +1300 Subject: [PATCH 5/5] update to x-; vocabs must not define x- keywords --- jsonschema-core.xml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index cf5aa190..c8fc6123 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -626,17 +626,16 @@
- The values of keywords which begin with the "@" symbol MUST be - collected as annotations. + The values of keywords which begin with "x-" MUST be collected as annotations. - Keywords which begin with the "@" symbol MUST NOT affect evaluation + Keywords which begin with "x-" symbol MUST NOT affect evaluation of a schema in any way other than annotation collection. - Consequently, the "@" symbol is reserved for this purpose, and - extension vocabularies which define keywords that start with "@" - MUST define them as annotation-only keywords. + Consequently, the "x-" prefix is reserved for this purpose, and + extension vocabularies MUST NOT define any keywords which begin + with this prefix.