@@ -459,8 +459,9 @@ This specification defines two such scopes: lexical and dynamic.
459
459
#### Lexical Scope
460
460
461
461
The lexical scope of a keyword is determined by the nested JSON data structure
462
- of objects and arrays. The largest such scope is an entire schema document. The
463
- smallest scope is a single schema object with no subschemas.
462
+ of objects and arrays. The smallest such scope is a single schema object with no
463
+ subschemas. The largest scope is an entire schema document, recursively
464
+ including all of its subschemas.
464
465
465
466
Keywords MAY be defined with a partial value which must be resolved against
466
467
another value found within the lexical structure of the JSON document. The
@@ -477,20 +478,21 @@ root object.
477
478
478
479
#### Dynamic Scope
479
480
480
- Other keywords may take into account the dynamic scope that exists during the
481
- evaluation of a schema, typically together with an instance document. The
482
- outermost dynamic scope is the schema object at which processing begins, even if
483
- it is not a schema resource root. The path from this root schema to any
484
- particular keyword (that includes any ` $ref ` and ` $dynamicRef ` keywords that may
485
- have been resolved) is considered the keyword's "evaluation path."
481
+ The dynamic scope is the ordered collection of schema objects navigated during
482
+ evaluation, starting at the root and ending at the subschema under evaluation.
483
+ The outermost dynamic scope is the schema object at which processing begins,
484
+ even if it is not a schema resource root. The path that evaluation takes,
485
+ starting from this root schema to any particular subschema (including any ` $ref `
486
+ and ` $dynamicRef ` keywords that may have been resolved), is considered the
487
+ "evaluation path".
486
488
487
489
Lexical and dynamic scopes align until a reference keyword is encountered. While
488
490
following the reference keyword moves processing from one lexical scope into a
489
491
different one, from the perspective of dynamic scope, following a reference is
490
492
no different from descending into a subschema present as a value. A keyword on
491
493
the far side of that reference that resolves information through the dynamic
492
494
scope will consider the originating side of the reference to be their dynamic
493
- parent, rather than examining the local lexically enclosing parent.
495
+ parent rather than examining the local lexically enclosing parent.
494
496
495
497
The concept of dynamic scope is primarily used with ` $dynamicRef ` and
496
498
` $dynamicAnchor ` , and should be considered an advanced feature and used with
@@ -930,9 +932,9 @@ to establish a base IRI in order to resolve the reference.
930
932
#### The ` $id ` Keyword {#id-keyword}
931
933
932
934
An ` $id ` keyword in a schema or subschema identifies that schema or subschema as
933
- a distinct schema resource and defines a new lexical scope. The value for this
934
- keyword MUST be a string, and MUST represent a valid IRI reference without a
935
- fragment.
935
+ a distinct schema resource and applies to the entire lexical scope of that
936
+ schema resource. The value for this keyword MUST be a string, and MUST represent
937
+ a valid IRI reference without a fragment.
936
938
937
939
When the value of this keyword is resolved against the current base IRI, the
938
940
resulting absolute IRI then serves as the identifier for the schema resource and
0 commit comments