625
625
URI-reference or a full URI, which is found through the lexical
626
626
structure of the JSON document. The "$id" core keyword and
627
627
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
629
629
this specification resolve their values in this way, although
630
630
they do not change how further values are resolved.
631
631
</t >
640
640
with an instance document. The outermost dynamic scope is the
641
641
root schema of the schema document in which processing begins.
642
642
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
644
644
been resolved) is considered the keyword's "validation path."
645
645
<cref >
646
646
Or should this be the schema object at which processing
647
647
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
649
649
root schema but processing begins in a subschema.
650
650
</cref >
651
651
</t >
660
660
dynamic parent, rather than examining the local lexically enclosing parent.
661
661
</t >
662
662
<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
665
665
and used with caution when defining additional keywords. It also appears
666
666
when reporting errors and collected annotations, as it may be possible
667
667
to revisit the same lexical scope repeatedly with different dynamic
723
723
<t >
724
724
While custom identifier keywords are possible, vocabulary designers should
725
725
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.
728
728
</t >
729
729
</section >
730
730
<section title =" Applicators" anchor =" applicators" >
775
775
For some by-reference applicators, such as
776
776
<xref target =" ref" >"$ref"</xref >, the referenced schema can be determined
777
777
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
779
779
scoping, and therefore only be resolvable in the process of evaluating
780
780
the schema with an instance.
781
781
</t >
1416
1416
<section title =" Schema References" anchor =" references" >
1417
1417
<t >
1418
1418
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 "
1421
1421
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.
1423
1423
</t >
1424
1424
<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
1426
1426
the possibility to externalise or divide a schema across multiple files,
1427
1427
and provides the ability to validate recursive structures through
1428
1428
self-reference.
1451
1451
</t >
1452
1452
</section >
1453
1453
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" >
1456
1456
<t >
1457
- The "$recursiveRef " and "$recursiveAnchor " keywords are used to construct
1457
+ The "$dyanmicRef " and "$dyanmicAnchor " keywords are used to construct
1458
1458
extensible recursive schemas. A recursive schema is one that has
1459
1459
a reference to its own root, identified by the empty fragment
1460
1460
URI reference ("#").
1461
1461
</t >
1462
1462
<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.
1465
1465
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
1467
1467
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
1469
1469
resolved, and do not impact any other keywords.
1470
1470
</t >
1471
1471
<t >
1477
1477
of these keywords.
1478
1478
</cref >
1479
1479
</t >
1480
- <section title =' Dynamically recursive references with "$recursiveRef "' >
1480
+ <section title =' Dynamically recursive references with "$dyanmicRef "' >
1481
1481
<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
1483
1483
a URI-reference. It is a by-reference applicator that uses
1484
1484
a dynamically calculated base URI to resolve its value.
1485
1485
</t >
1492
1492
</cref >
1493
1493
</t >
1494
1494
<t >
1495
- The value of "$recursiveRef " is initially resolved against the
1495
+ The value of "$dynamicRef " is initially resolved against the
1496
1496
current base URI, in the same manner as for "$ref".
1497
1497
</t >
1498
1498
<t >
1499
1499
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
1501
1501
as described for that keyword in the following section.
1502
1502
</t >
1503
1503
<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
1506
1506
the final resolved reference URI.
1507
1507
</t >
1508
1508
<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
1511
1511
that of "$ref".
1512
1512
</t >
1513
1513
<t >
1514
1514
As with "$ref", the results of this keyword are the results of the
1515
1515
referenced schema.
1516
1516
</t >
1517
1517
</section >
1518
- <section title =' Enabling Recursion with "$recursiveAnchor "' >
1518
+ <section title =' Enabling Recursion with "$dynamicAnchor "' >
1519
1519
<t >
1520
- The value of the "$recursiveAnchor " property MUST be a boolean.
1520
+ The value of the "$dynamicAnchor " property MUST be a boolean.
1521
1521
</t >
1522
1522
<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
1525
1525
can start, and where it stops. This keyword MUST NOT affect the
1526
1526
base URI of other keywords, unless they are explicitly defined
1527
1527
to rely on it.
1528
1528
</t >
1529
1529
<t >
1530
1530
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
1532
1532
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 "
1534
1534
with a value of true. The base URI of that schema is then used
1535
1535
as the dynamic base URI.
1536
1536
</t >
2670
2670
<t >
2671
2671
The relative location of the validating keyword that follows the validation
2672
2672
path. The value MUST be expressed as a JSON Pointer, and it MUST include
2673
- any by-reference applicators such as "$ref" or "$recursiveRef ".
2673
+ any by-reference applicators such as "$ref" or "$dynamicRef ".
2674
2674
</t >
2675
2675
<figure >
2676
2676
<artwork >
2693
2693
The absolute, dereferenced location of the validating keyword. The value MUST
2694
2694
be expressed as an absolute URI using the canonical URI of the relevant
2695
2695
schema object, and it MUST NOT include by-reference applicators
2696
- such as "$ref" or "$recursiveRef " as non-terminal path components.
2696
+ such as "$ref" or "$dynamicRef " as non-terminal path components.
2697
2697
It MAY end in such keywords if the error or annotation is for that
2698
2698
keyword, such as an unresolvable reference.
2699
2699
</t >
@@ -3461,15 +3461,15 @@ https://example.com/schemas/common#/$defs/count/minimum
3461
3461
{
3462
3462
"$schema": "https://json-schema.org/draft/2019-09/schema",
3463
3463
"$id": "https://example.com/tree",
3464
- "$recursiveAnchor ": true,
3464
+ "$dynamicAnchor ": true,
3465
3465
3466
3466
"type": "object",
3467
3467
"properties": {
3468
3468
"data": true,
3469
3469
"children": {
3470
3470
"type": "array",
3471
3471
"items": {
3472
- "$recursiveRef ": "#"
3472
+ "$dynamicRef ": "#"
3473
3473
}
3474
3474
}
3475
3475
}
@@ -3479,7 +3479,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3479
3479
{
3480
3480
"$schema": "https://json-schema.org/draft/2019-09/schema",
3481
3481
"$id": "https://example.com/strict-tree",
3482
- "$recursiveAnchor ": true,
3482
+ "$dynamicAnchor ": true,
3483
3483
3484
3484
"$ref": "tree",
3485
3485
"unevaluatedProperties": false
@@ -3495,23 +3495,23 @@ https://example.com/schemas/common#/$defs/count/minimum
3495
3495
<t >
3496
3496
If we apply the "strict-tree" schema to the instance, we will follow
3497
3497
the "$ref" to the "tree" schema, examine its "children" subschema,
3498
- and find the "$recursiveAnchor " in its "items" subschema.
3498
+ and find the "$dynamicAnchor " in its "items" subschema.
3499
3499
At this point, the dynamic path is
3500
- "#/$ref/properties/children/items/$recursiveRef ".
3500
+ "#/$ref/properties/children/items/$dynamicRef ".
3501
3501
</t >
3502
3502
<t >
3503
3503
The base URI at this point is "https://example.com/tree", so the
3504
- "$recursiveRef " initially resolves to "https://example.com/tree#".
3505
- Since "$recursiveAnchor " is true, we examine the dynamic path to
3504
+ "$dynamicRef " initially resolves to "https://example.com/tree#".
3505
+ Since "$dynamicAnchor " is true, we examine the dynamic path to
3506
3506
see if there is a different base URI to use. We find
3507
- "$recursiveAnchor " with a true value at the dynamic paths of
3507
+ "$dynamicAnchor " with a true value at the dynamic paths of
3508
3508
"#" and "#/$ref".
3509
3509
</t >
3510
3510
<t >
3511
3511
The outermost is "#", which is the root schema of the "strict-tree"
3512
3512
schema, so we use its base URI of "https://example.com/strict-tree",
3513
3513
which produces a final resolved URI of
3514
- "https://example.com/strict-tree#" for the "$recursiveRef ".
3514
+ "https://example.com/strict-tree#" for the "$dynamicRef ".
3515
3515
</t >
3516
3516
<t >
3517
3517
This way, the recursion in the "tree" schema recurses to the root
@@ -3560,8 +3560,8 @@ https://example.com/schemas/common#/$defs/count/minimum
3560
3560
appropriate for certain use cases.
3561
3561
</t >
3562
3562
<t >
3563
- The recursive nature of meta-schemas makes the "$recursiveAnchor "
3564
- and "$recursiveRef " keywords particularly useful for extending
3563
+ The recursive nature of meta-schemas makes the "$dynamicAnchor "
3564
+ and "$dynamicRef " keywords particularly useful for extending
3565
3565
existing meta-schemas, as can be seen in the JSON Hyper-Schema meta-schema
3566
3566
which extends the Validation meta-schema.
3567
3567
</t >
@@ -3617,7 +3617,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3617
3617
{
3618
3618
"$schema": "https://json-schema.org/draft/2019-09/schema",
3619
3619
"$id": "https://example.com/meta/general-use-example",
3620
- "$recursiveAnchor ": true,
3620
+ "$dynamicAnchor ": true,
3621
3621
"$vocabulary": {
3622
3622
"https://json-schema.org/draft/2019-09/vocab/core": true,
3623
3623
"https://json-schema.org/draft/2019-09/vocab/applicator": true,
@@ -3652,7 +3652,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3652
3652
{
3653
3653
"$schema": "https://json-schema.org/draft/2019-09/schema",
3654
3654
"$id": "https://example.com/meta/example-vocab",
3655
- "$recursiveAnchor ": true,
3655
+ "$dynamicAnchor ": true,
3656
3656
"$vocabulary": {
3657
3657
"https://example.com/vocab/example-vocab": true,
3658
3658
},
0 commit comments