Skip to content

Commit 593bf0b

Browse files
authored
Merge pull request #1053 from jdesrosiers/revert-dynamic-scope-changes
Revert changes to dynamic scope regarding dependence on instance
2 parents 3f37f7f + f5cc937 commit 593bf0b

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

jsonschema-core.xml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -654,11 +654,13 @@
654654
appear in a schema resource's root schema.
655655
</t>
656656
<t>
657-
Other keywords may take into account the dynamic scope that exists during the
658-
evaluation of a schema. The outermost dynamic scope is the root schema of the
659-
schema document in which processing begins. The path from this root schema to
660-
any particular keyword (that includes any "$ref" and "$dynamicRef" keywords that
661-
may have been resolved) is considered the keyword's "validation path."
657+
Other keywords may take into account the dynamic scope that
658+
exists during the evaluation of a schema, typically together
659+
with an instance document. The outermost dynamic scope is the
660+
root schema of the schema document in which processing begins.
661+
The path from this root schema to any particular keyword (that
662+
includes any "$ref" and "$dynamicRef" keywords that may have
663+
been resolved) is considered the keyword's "validation path."
662664
</t>
663665
<t>
664666
Lexical and dynamic scopes align until a reference keyword
@@ -733,7 +735,7 @@
733735
<t>
734736
Canonical schema URIs MUST NOT change while processing an instance, but
735737
keywords that affect URI-reference resolution MAY have behavior that
736-
is only fully determined dynamically.
738+
is only fully determined at runtime.
737739
</t>
738740
<t>
739741
While custom identifier keywords are possible, vocabulary designers should
@@ -790,10 +792,12 @@
790792
of an instance against a schema.
791793
</t>
792794
<t>
793-
For some by-reference applicators, such as <xref target="ref">"$ref"</xref>, the
794-
referenced schema can be determined by static analysis of the schema document's
795-
lexical scope. Others, such as "$dynamicRef" (with "$dynamicAnchor"), are only
796-
resolvable with knowledge of all the schemas in it's dynamic scope.
795+
For some by-reference applicators, such as
796+
<xref target="ref">"$ref"</xref>, the referenced schema can be determined
797+
by static analysis of the schema document's lexical scope. Others,
798+
such as "$dynamicRef" (with "$dynamicAnchor"), may make use of dynamic
799+
scoping, and therefore only be resolvable in the process of evaluating
800+
the schema with an instance.
797801
</t>
798802
</section>
799803
</section>
@@ -1462,28 +1466,30 @@
14621466
<t>
14631467
The value of the "$ref" keyword MUST be a string which is a URI-Reference.
14641468
Resolved against the current URI base, it produces the URI of the schema
1465-
to apply. This resolution is safe to perform on schema load as neither other
1466-
schemas nor the instance can change how the reference resolves.
1469+
to apply. This resolution is safe to perform on schema load, as the
1470+
process of evaluating an instance cannot change how the reference resolves.
14671471
</t>
14681472
</section>
14691473

14701474
<section title='Dynamic References with "$dynamicRef"' anchor="dynamic-ref">
14711475
<t>
1472-
The "$dynamicRef" keyword is an applicator that is used to reference a
1473-
dynamically identified schema.
1476+
The "$dynamicRef" keyword is an applicator that allows for deferring the
1477+
full resolution until runtime, at which point it is resolved each time it is
1478+
encountered while evaluating an instance.
14741479
</t>
14751480
<t>
14761481
Together with "$dynamicAnchor", "$dynamicRef" implements a cooperative
14771482
extension mechanism that is primarily useful with recursive schemas
14781483
(schemas that reference themselves). Both the extension point and the
1479-
extension target are defined with "$dynamicAnchor", and only exhibit dynamic
1480-
behavior when referenced with "$dynamicRef".
1484+
runtime-determined extension target are defined with "$dynamicAnchor",
1485+
and only exhibit runtime dynamic behavior when referenced with
1486+
"$dynamicRef".
14811487
</t>
14821488
<t>
1483-
The value of the "$dynamicRef" property MUST be a string which is a
1484-
URI-Reference. Resolved against the current URI base, it produces the URI used
1485-
as the starting point for resolution. This initial resolution is safe to perform
1486-
on schema load.
1489+
The value of the "$dynamicRef" property MUST be a string which is
1490+
a URI-Reference. Resolved against the current URI base, it produces
1491+
the URI used as the starting point for runtime resolution. This initial
1492+
resolution is safe to perform on schema load.
14871493
</t>
14881494
<t>
14891495
If the initially resolved starting point URI includes a fragment that
@@ -1493,8 +1499,8 @@
14931499
an identically named fragment with "$dynamicAnchor".
14941500
</t>
14951501
<t>
1496-
Otherwise, its behavior is identical to "$ref", and no dynamic resolution is
1497-
needed.
1502+
Otherwise, its behavior is identical to "$ref", and no runtime
1503+
resolution is needed.
14981504
</t>
14991505
<t>
15001506
For a full example using these keyword, see appendix

0 commit comments

Comments
 (0)