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 >
2680
2680
<t >
2681
2681
The relative location of the validating keyword that follows the validation
2682
2682
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 ".
2684
2684
</t >
2685
2685
<figure >
2686
2686
<artwork >
2703
2703
The absolute, dereferenced location of the validating keyword. The value MUST
2704
2704
be expressed as an absolute URI using the canonical URI of the relevant
2705
2705
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.
2707
2707
It MAY end in such keywords if the error or annotation is for that
2708
2708
keyword, such as an unresolvable reference.
2709
2709
</t >
@@ -3471,15 +3471,15 @@ https://example.com/schemas/common#/$defs/count/minimum
3471
3471
{
3472
3472
"$schema": "https://json-schema.org/draft/2019-09/schema",
3473
3473
"$id": "https://example.com/tree",
3474
- "$recursiveAnchor ": true,
3474
+ "$dynamicAnchor ": true,
3475
3475
3476
3476
"type": "object",
3477
3477
"properties": {
3478
3478
"data": true,
3479
3479
"children": {
3480
3480
"type": "array",
3481
3481
"items": {
3482
- "$recursiveRef ": "#"
3482
+ "$dynamicRef ": "#"
3483
3483
}
3484
3484
}
3485
3485
}
@@ -3489,7 +3489,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3489
3489
{
3490
3490
"$schema": "https://json-schema.org/draft/2019-09/schema",
3491
3491
"$id": "https://example.com/strict-tree",
3492
- "$recursiveAnchor ": true,
3492
+ "$dynamicAnchor ": true,
3493
3493
3494
3494
"$ref": "tree",
3495
3495
"unevaluatedProperties": false
@@ -3505,23 +3505,23 @@ https://example.com/schemas/common#/$defs/count/minimum
3505
3505
<t >
3506
3506
If we apply the "strict-tree" schema to the instance, we will follow
3507
3507
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.
3509
3509
At this point, the dynamic path is
3510
- "#/$ref/properties/children/items/$recursiveRef ".
3510
+ "#/$ref/properties/children/items/$dynamicRef ".
3511
3511
</t >
3512
3512
<t >
3513
3513
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
3516
3516
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
3518
3518
"#" and "#/$ref".
3519
3519
</t >
3520
3520
<t >
3521
3521
The outermost is "#", which is the root schema of the "strict-tree"
3522
3522
schema, so we use its base URI of "https://example.com/strict-tree",
3523
3523
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 ".
3525
3525
</t >
3526
3526
<t >
3527
3527
This way, the recursion in the "tree" schema recurses to the root
@@ -3570,8 +3570,8 @@ https://example.com/schemas/common#/$defs/count/minimum
3570
3570
appropriate for certain use cases.
3571
3571
</t >
3572
3572
<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
3575
3575
existing meta-schemas, as can be seen in the JSON Hyper-Schema meta-schema
3576
3576
which extends the Validation meta-schema.
3577
3577
</t >
@@ -3627,7 +3627,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3627
3627
{
3628
3628
"$schema": "https://json-schema.org/draft/2019-09/schema",
3629
3629
"$id": "https://example.com/meta/general-use-example",
3630
- "$recursiveAnchor ": true,
3630
+ "$dynamicAnchor ": true,
3631
3631
"$vocabulary": {
3632
3632
"https://json-schema.org/draft/2019-09/vocab/core": true,
3633
3633
"https://json-schema.org/draft/2019-09/vocab/applicator": true,
@@ -3662,7 +3662,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3662
3662
{
3663
3663
"$schema": "https://json-schema.org/draft/2019-09/schema",
3664
3664
"$id": "https://example.com/meta/example-vocab",
3665
- "$recursiveAnchor ": true,
3665
+ "$dynamicAnchor ": true,
3666
3666
"$vocabulary": {
3667
3667
"https://example.com/vocab/example-vocab": true,
3668
3668
},
0 commit comments