Skip to content

Commit e496904

Browse files
committed
update dynamic scope to be defined by resources
1 parent 767debd commit e496904

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

specs/jsonschema-core.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -477,27 +477,27 @@ root object.
477477

478478
#### Dynamic Scope
479479

480-
The dynamic scope is the ordered collection of schema objects navigated during
481-
evaluation, starting at the root and ending at the subschema under evaluation.
482-
The outermost dynamic scope is the schema object at which processing begins,
483-
even if it is not a schema resource root. The path that evaluation takes,
484-
starting from this root schema to any particular subschema (including any `$ref`
480+
The dynamic scope is the ordered collection of schema resources navigated during
481+
evaluation, starting at the root and ending at the schema resource which
482+
contains the subschema under evaluation. The outermost dynamic scope is the
483+
schema resource at which processing begins. The path that evaluation takes,
484+
starting from the subschema to any particular subschema (including any `$ref`
485485
and `$dynamicRef` keywords that may have been resolved), is considered the
486486
"evaluation path".
487487

488488
Lexical and dynamic scopes align until a reference keyword is encountered. While
489-
following the reference moves processing from one lexical scope into a
490-
different one, from the perspective of dynamic scope, following a reference is
491-
no different from descending into a subschema present as a value. A keyword on
492-
the far side of that reference that resolves information through the dynamic
493-
scope will consider the originating side of the reference to be its dynamic
494-
parent rather than examining the local lexically enclosing parent.
489+
following the reference moves processing from one lexical scope into a different
490+
one, from the perspective of dynamic scope, following a reference is no
491+
different from descending into a subschema. A keyword on the far side of the
492+
reference that resolves information through the dynamic scope will consider the
493+
originating side of the reference to be its dynamic parent rather than examining
494+
the local lexically enclosing parent.
495495

496496
The concept of dynamic scope is primarily used with `$dynamicRef` and
497497
`$dynamicAnchor`, and should be considered an advanced feature and used with
498498
caution when defining additional keywords. It also appears when reporting errors
499499
and collected annotations, as it may be possible to revisit the same lexical
500-
scope repeatedly with different dynamic scopes. In such cases, it is important
500+
scope repeatedly with different dynamic scopes. For this reason, it is important
501501
to inform the user of the evaluation path that produced the error or annotation.
502502

503503
### Keyword Interactions

0 commit comments

Comments
 (0)