Skip to content

Commit b920bc7

Browse files
committed
Dynamic scope resolution doesn't require instance
1 parent 03a1b97 commit b920bc7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

jsonschema-core.xml

+9-9
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@
666666
Lexical and dynamic scopes align until a reference keyword
667667
is encountered. While following the reference keyword moves processing
668668
from one lexical scope into a different one, from the perspective
669-
of dynamic scope, following reference is no different from descending
669+
of dynamic scope, following a reference is no different from descending
670670
into a subschema present as a value. A keyword on the far side of
671671
that reference that resolves information through the dynamic scope
672672
will consider the originating side of the reference to be their
@@ -795,9 +795,8 @@
795795
For some by-reference applicators, such as
796796
<xref target="ref">"$ref"</xref>, the referenced schema can be determined
797797
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.
798+
such as "$dynamicRef" (with "$dynamicAnchor"), are only resolvable in the context
799+
of the dynamic scope.
801800
</t>
802801
</section>
803802
</section>
@@ -1445,8 +1444,8 @@
14451444
<t>
14461445
The value of the "$ref" keyword MUST be a string which is a URI-Reference.
14471446
Resolved against the current URI base, it produces the URI of the schema
1448-
to apply. This resolution is safe to perform on schema load, as the
1449-
process of evaluating an instance cannot change how the reference resolves.
1447+
to apply. This resolution is safe to perform on schema load as neither other
1448+
schemas nor the instance can change how the reference resolves.
14501449
</t>
14511450
</section>
14521451

@@ -1464,9 +1463,10 @@
14641463
</t>
14651464
<t>
14661465
The value of the "$dynamicRef" keyword MUST be a string which is a URI-Reference.
1467-
Resolved against the URI base, it produces the URI of the schema to apply. This
1468-
resolution is not safe to perform on schema load, as the process of evaluating an
1469-
instance can change how the reference resolves.
1466+
Resolved against the dynamically determined URI base, it produces the URI of the
1467+
schema to apply. This resolution is not safe to perform on schema load because
1468+
the dynamic scope is not known. It is safe to perform this resolution as part of
1469+
a compile step where all schemas involved have been loaded.
14701470
</t>
14711471
<t>
14721472
For a full example using these keyword, see appendix

0 commit comments

Comments
 (0)