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