From 136b55fe36b777b44ebadaf51c6b8dc6c44e8768 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Thu, 21 Sep 2023 10:36:37 +1200 Subject: [PATCH 1/9] add section about annotation-based keyword interaction being illustrative --- jsonschema-core.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index 84a6579c..c13cac00 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -523,11 +523,23 @@ to inform the user of the evaluation path that produced the error or annotation. ### Keyword Interactions -Keyword behavior MAY be defined in terms of the annotation results of -[subschemas](#root) and/or adjacent keywords (keywords within the same schema -object) and their subschemas. Such keywords MUST NOT result in a circular -dependency. Keywords MAY modify their behavior based on the presence or absence -of another keyword in the same [schema object](#schema-document). +Keywords MAY modify their behavior based on the presence or absence of another +keyword in the same [schema object](#schema-document). Such keywords MUST NOT +result in a circular dependency. + +Unless otherwise specified, keywords act independently. + +#### Annotations as an Interaction Mechanism + +This document uses annotations as a mechanism to describe the interactions +between keywords, however this is for illustrative purposes and not +prescriptive. Implementations SHOULD use whatever mechanisms makes sense given +their architecture and language needs in order to achieve the specified +behaviors. Implementations are not required to collect annotations in order to +manage keyword interaction. + +Supplementary specifications are also encouraged to use annotations to describe +any interactions of the keywords they define. ### Default Behaviors {#default-behaviors} From 7c3571959fd2a6d68c606b79126a13c15f546cfd Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Mon, 25 Sep 2023 09:49:14 +1300 Subject: [PATCH 2/9] implementations MAY use their own mechanisms for keyword interaction --- jsonschema-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index c13cac00..d8ee8a76 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -533,7 +533,7 @@ Unless otherwise specified, keywords act independently. This document uses annotations as a mechanism to describe the interactions between keywords, however this is for illustrative purposes and not -prescriptive. Implementations SHOULD use whatever mechanisms makes sense given +prescriptive. Implementations MAY use whatever mechanisms makes sense given their architecture and language needs in order to achieve the specified behaviors. Implementations are not required to collect annotations in order to manage keyword interaction. From 007fa9885f84f6009d3f3e0f81f06ebe3b1bc1c9 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Wed, 27 Sep 2023 08:51:27 +1300 Subject: [PATCH 3/9] add that keywords can be depenedent upon other keywords' values --- jsonschema-core.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index d8ee8a76..4cc8ab6d 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -524,8 +524,8 @@ to inform the user of the evaluation path that produced the error or annotation. ### Keyword Interactions Keywords MAY modify their behavior based on the presence or absence of another -keyword in the same [schema object](#schema-document). Such keywords MUST NOT -result in a circular dependency. +keyword or its value in the same [schema object](#schema-document). Such +keywords MUST NOT result in a circular dependency. Unless otherwise specified, keywords act independently. From 130df84bdae0fb275e009cad977d80488f23adc5 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Sat, 30 Sep 2023 12:08:40 +1300 Subject: [PATCH 4/9] improve language around sibling keyword behavior --- jsonschema-core.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index 4cc8ab6d..e8b8b7c5 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -523,9 +523,9 @@ to inform the user of the evaluation path that produced the error or annotation. ### Keyword Interactions -Keywords MAY modify their behavior based on the presence or absence of another -keyword or its value in the same [schema object](#schema-document). Such -keywords MUST NOT result in a circular dependency. +Keywords MAY modify their behavior based on the presence, absence, or value of +another keyword in the same [schema object](#schema-document). Such keywords +MUST NOT result in a circular dependency. Unless otherwise specified, keywords act independently. From d92e92a9913f610adf1115b3d990926150e16255 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Sat, 30 Sep 2023 12:19:41 +1300 Subject: [PATCH 5/9] add lanugage to specify where dependent behavior should be defined --- jsonschema-core.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jsonschema-core.md b/jsonschema-core.md index e8b8b7c5..b9a9ab56 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -529,6 +529,8 @@ MUST NOT result in a circular dependency. Unless otherwise specified, keywords act independently. +Supplementary specifications are encouraged to specify any interactive behavior as part of the keyword whose behavior is modified. + #### Annotations as an Interaction Mechanism This document uses annotations as a mechanism to describe the interactions From 92b786015bf2b24fc1f7737afc68d725e5fd8039 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Thu, 5 Oct 2023 16:43:44 +1300 Subject: [PATCH 6/9] define multiple mechanisms --- jsonschema-core.md | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index b9a9ab56..872ad020 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -523,25 +523,29 @@ to inform the user of the evaluation path that produced the error or annotation. ### Keyword Interactions -Keywords MAY modify their behavior based on the presence, absence, or value of -another keyword in the same [schema object](#schema-document). Such keywords -MUST NOT result in a circular dependency. - Unless otherwise specified, keywords act independently. -Supplementary specifications are encouraged to specify any interactive behavior as part of the keyword whose behavior is modified. - -#### Annotations as an Interaction Mechanism - -This document uses annotations as a mechanism to describe the interactions -between keywords, however this is for illustrative purposes and not -prescriptive. Implementations MAY use whatever mechanisms makes sense given -their architecture and language needs in order to achieve the specified -behaviors. Implementations are not required to collect annotations in order to -manage keyword interaction. - -Supplementary specifications are also encouraged to use annotations to describe -any interactions of the keywords they define. +Keywords MAY modify their behavior based on the presence, absence, or value of +another keyword in the same schema object. Such keywords MUST NOT result in a +circular dependency. + +Supplementary specifications are encouraged to specify any dependencies as part +of the dependent keyword (i.e. the keyword whose behavior is modified). + +Within this document, keyword dependencies are expressed using one of the +following mechanics: + +- Static dependencies, in which the dependency relies on the presence or + contents of another keyword. +- Dynamic dependencies, in which the dependency relies on the evaluation of + another keyword against an instance. This dependency may be on either the + annotations produced by the keyword or the validation result of its + subschema(s). + +These mechanics are used merely to describe dependencies; they are for +illustrative purposes and not prescriptive. Implementations MAY use whatever +mechanisms makes sense given the needs of their architecture and language in +order to achieve the specified behaviors. ### Default Behaviors {#default-behaviors} From a7698d456bf759086c8142edbf1d0979cc65f54f Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Thu, 5 Oct 2023 20:58:34 +1300 Subject: [PATCH 7/9] fix grammatical error --- jsonschema-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index 872ad020..b498d4f0 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -544,7 +544,7 @@ following mechanics: These mechanics are used merely to describe dependencies; they are for illustrative purposes and not prescriptive. Implementations MAY use whatever -mechanisms makes sense given the needs of their architecture and language in +mechanisms make sense given the needs of their architecture and language in order to achieve the specified behaviors. ### Default Behaviors {#default-behaviors} From 6caa3708300df8a7d2d1c282c9b605506e5e14c9 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Fri, 6 Oct 2023 12:18:20 +1300 Subject: [PATCH 8/9] mechanics -> mechanisms Co-authored-by: Jason Desrosiers --- jsonschema-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index b498d4f0..b5588bb8 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -533,7 +533,7 @@ Supplementary specifications are encouraged to specify any dependencies as part of the dependent keyword (i.e. the keyword whose behavior is modified). Within this document, keyword dependencies are expressed using one of the -following mechanics: +following mechanisms: - Static dependencies, in which the dependency relies on the presence or contents of another keyword. From a5f578296b1523f87d00af467b4b58ce022942d6 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Wed, 12 Jun 2024 11:07:57 +1200 Subject: [PATCH 9/9] be consistent with language --- jsonschema-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index b5588bb8..24cfa30a 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -542,7 +542,7 @@ following mechanisms: annotations produced by the keyword or the validation result of its subschema(s). -These mechanics are used merely to describe dependencies; they are for +These mechanisms are used merely to describe dependencies; they are for illustrative purposes and not prescriptive. Implementations MAY use whatever mechanisms make sense given the needs of their architecture and language in order to achieve the specified behaviors.