From d7a700b6da95281f30aa70df740605d02ad036f5 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Tue, 19 Oct 2021 16:38:48 -0700 Subject: [PATCH 1/2] Remove bookending requirement for dynamicRef --- jsonschema-core.xml | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 7179716f..3caabd28 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -1483,27 +1483,22 @@ Together with "$dynamicAnchor", "$dynamicRef" implements a cooperative extension mechanism that is primarily useful with recursive schemas - (schemas that reference themselves). Both the extension point and the - runtime-determined extension target are defined with "$dynamicAnchor", - and only exhibit runtime dynamic behavior when referenced with - "$dynamicRef". + (schemas that reference themselves). The extension point is defined with + "$dynamicAnchor" and only exhibits runtime dynamic behavior when referenced + with "$dynamicRef". - The value of the "$dynamicRef" property MUST be a string which is - a IRI-Reference. Resolved against the current IRI base, it produces - the IRI used as the starting point for runtime resolution. This initial - resolution is safe to perform on schema load. + The value of the "$dynamicRef" property MUST be a string which is a + IRI-Reference that contains a valid plain name + fragment. Resolved against the current IRI base, it indicates + the schema resource used as the starting point for runtime resolution. + This initial resolution is safe to perform on schema load. - If the initially resolved starting point IRI includes a fragment that - was created by the "$dynamicAnchor" keyword, the initial IRI MUST be - replaced by the IRI (including the fragment) for the outermost schema - resource in the dynamic scope that defines - an identically named fragment with "$dynamicAnchor". - - - Otherwise, its behavior is identical to "$ref", and no runtime - resolution is needed. + The schema to apply is the outermost schema resource in the + dynamic scope that defines a + "$dynamicAnchor" that matches the plain name fragment in the initially + resolved IRI. For a full example using these keyword, see appendix From f7df2391178a334beca91964efdc50f4214af8e6 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Thu, 21 Oct 2021 14:11:05 -0700 Subject: [PATCH 2/2] Add $dynamicRef changes to change log --- jsonschema-core.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 3caabd28..02b0a9a4 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -3858,6 +3858,7 @@ https://example.com/schemas/common#/$defs/count/minimum "contains" now applies to objects as well as arrays + Remove bookending requirement for "$dynamicRef"