Skip to content

Commit 1c9d8d2

Browse files
committed
Rename "$recursive*" to "$dynamic*"
Preliminary work for revamping these keywords.
1 parent ed69fd3 commit 1c9d8d2

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

jsonschema-core.xml

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@
625625
URI-reference or a full URI, which is found through the lexical
626626
structure of the JSON document. The "$id" core keyword and
627627
the "base" JSON Hyper-Schema keyword are examples of this sort
628-
of behavior. Additionally, "$ref" and "$recursiveRef" from
628+
of behavior. Additionally, "$ref" and "$dyanmicRef" from
629629
this specification resolve their values in this way, although
630630
they do not change how further values are resolved.
631631
</t>
@@ -640,12 +640,12 @@
640640
with an instance document. The outermost dynamic scope is the
641641
root schema of the schema document in which processing begins.
642642
The path from this root schema to any particular keyword (that
643-
includes any "$ref" and "$recursiveRef" keywords that may have
643+
includes any "$ref" and "$dyanmicRef" keywords that may have
644644
been resolved) is considered the keyword's "validation path."
645645
<cref>
646646
Or should this be the schema object at which processing
647647
begins, even if it is not a root? This has some implications
648-
for the case where "$recursiveAnchor" is only allowed in the
648+
for the case where "$dyanmicAnchor" is only allowed in the
649649
root schema but processing begins in a subschema.
650650
</cref>
651651
</t>
@@ -660,8 +660,8 @@
660660
dynamic parent, rather than examining the local lexically enclosing parent.
661661
</t>
662662
<t>
663-
The concept of dynamic scope is primarily used with "$recursiveRef" and
664-
"$recursiveAnchor", and should be considered an advanced feature
663+
The concept of dynamic scope is primarily used with "$dyanmicRef" and
664+
"$dyanmicAnchor", and should be considered an advanced feature
665665
and used with caution when defining additional keywords. It also appears
666666
when reporting errors and collected annotations, as it may be possible
667667
to revisit the same lexical scope repeatedly with different dynamic
@@ -723,8 +723,8 @@
723723
<t>
724724
While custom identifier keywords are possible, vocabulary designers should
725725
take care not to disrupt the functioning of core keywords. For example,
726-
the "$recursiveAnchor" keyword in this specification limits its URI resolution
727-
effects to the matching "$recursiveRef" keyword, leaving "$ref" undisturbed.
726+
the "$dyanmicAnchor" keyword in this specification limits its URI resolution
727+
effects to the matching "$dyanmicRef" keyword, leaving "$ref" undisturbed.
728728
</t>
729729
</section>
730730
<section title="Applicators" anchor="applicators">
@@ -775,7 +775,7 @@
775775
For some by-reference applicators, such as
776776
<xref target="ref">"$ref"</xref>, the referenced schema can be determined
777777
by static analysis of the schema document's lexical scope. Others,
778-
such as "$recursiveRef" and "$recursiveAnchor", may make use of dynamic
778+
such as "$dyanmicRef" and "$dyanmicAnchor", may make use of dynamic
779779
scoping, and therefore only be resolvable in the process of evaluating
780780
the schema with an instance.
781781
</t>
@@ -1416,13 +1416,13 @@
14161416
<section title="Schema References" anchor="references">
14171417
<t>
14181418
Several keywords can be used to reference a schema which is to be applied to the
1419-
current instance location. "$ref" and "$recursiveRef" are applicator
1420-
keywords, applying the referenced schema to the instance. "$recursiveAnchor"
1419+
current instance location. "$ref" and "$dyanmicRef" are applicator
1420+
keywords, applying the referenced schema to the instance. "$dyanmicAnchor"
14211421
is an identifier keyword that controls how the base URI for resolving
1422-
the URI-reference value of "$recursiveRef is determined.
1422+
the URI-reference value of "$dyanmicRef is determined.
14231423
</t>
14241424
<t>
1425-
As the values of "$ref" and "$recursiveRef" are URI References, this allows
1425+
As the values of "$ref" and "$dynamicRef" are URI References, this allows
14261426
the possibility to externalise or divide a schema across multiple files,
14271427
and provides the ability to validate recursive structures through
14281428
self-reference.
@@ -1451,21 +1451,21 @@
14511451
</t>
14521452
</section>
14531453

1454-
<section title='Recursive References with "$recursiveRef" and "$recursiveAnchor"'
1455-
anchor="recursive-ref">
1454+
<section title='Dynamic References with "$dynamicRef" and "$dynamicAnchor"'
1455+
anchor="dynamic-ref">
14561456
<t>
1457-
The "$recursiveRef" and "$recursiveAnchor" keywords are used to construct
1457+
The "$dyanmicRef" and "$dyanmicAnchor" keywords are used to construct
14581458
extensible recursive schemas. A recursive schema is one that has
14591459
a reference to its own root, identified by the empty fragment
14601460
URI reference ("#").
14611461
</t>
14621462
<t>
1463-
Simply stated, a "$recursiveRef" behaves identically to "$ref", except
1464-
when its target schema contains "$recursiveAnchor" with a value of true.
1463+
Simply stated, a "$dynamicRef" behaves identically to "$ref", except
1464+
when its target schema contains "$dynamicAnchor" with a value of true.
14651465
In that case, the dynamic scope is examined to determine a new base URI,
1466-
and the URI-reference in "$recursiveRef" is re-evaluated against that
1466+
and the URI-reference in "$dynamicRef" is re-evaluated against that
14671467
base URI. Unlike base URI changes with "$id", changes with
1468-
"$recursiveAnchor" are calculated each time a "$recursiveRef" is
1468+
"$dynamicAnchor" are calculated each time a "$dynamicRef" is
14691469
resolved, and do not impact any other keywords.
14701470
</t>
14711471
<t>
@@ -1477,9 +1477,9 @@
14771477
of these keywords.
14781478
</cref>
14791479
</t>
1480-
<section title='Dynamically recursive references with "$recursiveRef"'>
1480+
<section title='Dynamically recursive references with "$dyanmicRef"'>
14811481
<t>
1482-
The value of the "$recursiveRef" property MUST be a string which is
1482+
The value of the "$dynamicRef" property MUST be a string which is
14831483
a URI-reference. It is a by-reference applicator that uses
14841484
a dynamically calculated base URI to resolve its value.
14851485
</t>
@@ -1492,45 +1492,45 @@
14921492
</cref>
14931493
</t>
14941494
<t>
1495-
The value of "$recursiveRef" is initially resolved against the
1495+
The value of "$dynamicRef" is initially resolved against the
14961496
current base URI, in the same manner as for "$ref".
14971497
</t>
14981498
<t>
14991499
The schema identified by the resulting URI is examined for the
1500-
presence of "$recursiveAnchor", and a new base URI is calculated
1500+
presence of "$dynamicAnchor", and a new base URI is calculated
15011501
as described for that keyword in the following section.
15021502
</t>
15031503
<t>
1504-
Finally, the value of "$recursiveRef" is resolved against the
1505-
new base URI determined according to "$recursiveAnchor" producing
1504+
Finally, the value of "$dynamicRef" is resolved against the
1505+
new base URI determined according to "$dynamicAnchor" producing
15061506
the final resolved reference URI.
15071507
</t>
15081508
<t>
1509-
Note that in the absence of "$recursiveAnchor" (and in some cases
1510-
when it is present), "$recursiveRef"'s behavior is identical to
1509+
Note that in the absence of "$dynamicAnchor" (and in some cases
1510+
when it is present), "$dynamicRef"'s behavior is identical to
15111511
that of "$ref".
15121512
</t>
15131513
<t>
15141514
As with "$ref", the results of this keyword are the results of the
15151515
referenced schema.
15161516
</t>
15171517
</section>
1518-
<section title='Enabling Recursion with "$recursiveAnchor"'>
1518+
<section title='Enabling Recursion with "$dynamicAnchor"'>
15191519
<t>
1520-
The value of the "$recursiveAnchor" property MUST be a boolean.
1520+
The value of the "$dynamicAnchor" property MUST be a boolean.
15211521
</t>
15221522
<t>
1523-
"$recursiveAnchor" is used to dynamically identify a base URI
1524-
at runtime for "$recursiveRef" by marking where such a calculation
1523+
"$dynamicAnchor" is used to dynamically identify a base URI
1524+
at runtime for "$dynamicRef" by marking where such a calculation
15251525
can start, and where it stops. This keyword MUST NOT affect the
15261526
base URI of other keywords, unless they are explicitly defined
15271527
to rely on it.
15281528
</t>
15291529
<t>
15301530
If set to true, then when the containing schema object is used
1531-
as a target of "$recursiveRef", a new base URI is determined
1531+
as a target of "$dynamicRef", a new base URI is determined
15321532
by examining the <xref target="scopes">dynamic scope</xref> for
1533-
the outermost schema that also contains "$recursiveAnchor"
1533+
the outermost schema that also contains "$dynamicAnchor"
15341534
with a value of true. The base URI of that schema is then used
15351535
as the dynamic base URI.
15361536
</t>
@@ -2680,7 +2680,7 @@
26802680
<t>
26812681
The relative location of the validating keyword that follows the validation
26822682
path. The value MUST be expressed as a JSON Pointer, and it MUST include
2683-
any by-reference applicators such as "$ref" or "$recursiveRef".
2683+
any by-reference applicators such as "$ref" or "$dynamicRef".
26842684
</t>
26852685
<figure>
26862686
<artwork>
@@ -2703,7 +2703,7 @@
27032703
The absolute, dereferenced location of the validating keyword. The value MUST
27042704
be expressed as an absolute URI using the canonical URI of the relevant
27052705
schema object, and it MUST NOT include by-reference applicators
2706-
such as "$ref" or "$recursiveRef" as non-terminal path components.
2706+
such as "$ref" or "$dynamicRef" as non-terminal path components.
27072707
It MAY end in such keywords if the error or annotation is for that
27082708
keyword, such as an unresolvable reference.
27092709
</t>
@@ -3471,15 +3471,15 @@ https://example.com/schemas/common#/$defs/count/minimum
34713471
{
34723472
"$schema": "https://json-schema.org/draft/2019-09/schema",
34733473
"$id": "https://example.com/tree",
3474-
"$recursiveAnchor": true,
3474+
"$dynamicAnchor": true,
34753475
34763476
"type": "object",
34773477
"properties": {
34783478
"data": true,
34793479
"children": {
34803480
"type": "array",
34813481
"items": {
3482-
"$recursiveRef": "#"
3482+
"$dynamicRef": "#"
34833483
}
34843484
}
34853485
}
@@ -3489,7 +3489,7 @@ https://example.com/schemas/common#/$defs/count/minimum
34893489
{
34903490
"$schema": "https://json-schema.org/draft/2019-09/schema",
34913491
"$id": "https://example.com/strict-tree",
3492-
"$recursiveAnchor": true,
3492+
"$dynamicAnchor": true,
34933493
34943494
"$ref": "tree",
34953495
"unevaluatedProperties": false
@@ -3505,23 +3505,23 @@ https://example.com/schemas/common#/$defs/count/minimum
35053505
<t>
35063506
If we apply the "strict-tree" schema to the instance, we will follow
35073507
the "$ref" to the "tree" schema, examine its "children" subschema,
3508-
and find the "$recursiveAnchor" in its "items" subschema.
3508+
and find the "$dynamicAnchor" in its "items" subschema.
35093509
At this point, the dynamic path is
3510-
"#/$ref/properties/children/items/$recursiveRef".
3510+
"#/$ref/properties/children/items/$dynamicRef".
35113511
</t>
35123512
<t>
35133513
The base URI at this point is "https://example.com/tree", so the
3514-
"$recursiveRef" initially resolves to "https://example.com/tree#".
3515-
Since "$recursiveAnchor" is true, we examine the dynamic path to
3514+
"$dynamicRef" initially resolves to "https://example.com/tree#".
3515+
Since "$dynamicAnchor" is true, we examine the dynamic path to
35163516
see if there is a different base URI to use. We find
3517-
"$recursiveAnchor" with a true value at the dynamic paths of
3517+
"$dynamicAnchor" with a true value at the dynamic paths of
35183518
"#" and "#/$ref".
35193519
</t>
35203520
<t>
35213521
The outermost is "#", which is the root schema of the "strict-tree"
35223522
schema, so we use its base URI of "https://example.com/strict-tree",
35233523
which produces a final resolved URI of
3524-
"https://example.com/strict-tree#" for the "$recursiveRef".
3524+
"https://example.com/strict-tree#" for the "$dynamicRef".
35253525
</t>
35263526
<t>
35273527
This way, the recursion in the "tree" schema recurses to the root
@@ -3570,8 +3570,8 @@ https://example.com/schemas/common#/$defs/count/minimum
35703570
appropriate for certain use cases.
35713571
</t>
35723572
<t>
3573-
The recursive nature of meta-schemas makes the "$recursiveAnchor"
3574-
and "$recursiveRef" keywords particularly useful for extending
3573+
The recursive nature of meta-schemas makes the "$dynamicAnchor"
3574+
and "$dynamicRef" keywords particularly useful for extending
35753575
existing meta-schemas, as can be seen in the JSON Hyper-Schema meta-schema
35763576
which extends the Validation meta-schema.
35773577
</t>
@@ -3627,7 +3627,7 @@ https://example.com/schemas/common#/$defs/count/minimum
36273627
{
36283628
"$schema": "https://json-schema.org/draft/2019-09/schema",
36293629
"$id": "https://example.com/meta/general-use-example",
3630-
"$recursiveAnchor": true,
3630+
"$dynamicAnchor": true,
36313631
"$vocabulary": {
36323632
"https://json-schema.org/draft/2019-09/vocab/core": true,
36333633
"https://json-schema.org/draft/2019-09/vocab/applicator": true,
@@ -3662,7 +3662,7 @@ https://example.com/schemas/common#/$defs/count/minimum
36623662
{
36633663
"$schema": "https://json-schema.org/draft/2019-09/schema",
36643664
"$id": "https://example.com/meta/example-vocab",
3665-
"$recursiveAnchor": true,
3665+
"$dynamicAnchor": true,
36663666
"$vocabulary": {
36673667
"https://example.com/vocab/example-vocab": true,
36683668
},

0 commit comments

Comments
 (0)