|
654 | 654 | appear in a schema resource's root schema.
|
655 | 655 | </t>
|
656 | 656 | <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." |
662 | 664 | </t>
|
663 | 665 | <t>
|
664 | 666 | Lexical and dynamic scopes align until a reference keyword
|
|
733 | 735 | <t>
|
734 | 736 | Canonical schema URIs MUST NOT change while processing an instance, but
|
735 | 737 | keywords that affect URI-reference resolution MAY have behavior that
|
736 |
| - is only fully determined dynamically. |
| 738 | + is only fully determined at runtime. |
737 | 739 | </t>
|
738 | 740 | <t>
|
739 | 741 | While custom identifier keywords are possible, vocabulary designers should
|
|
790 | 792 | of an instance against a schema.
|
791 | 793 | </t>
|
792 | 794 | <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. |
797 | 801 | </t>
|
798 | 802 | </section>
|
799 | 803 | </section>
|
|
1462 | 1466 | <t>
|
1463 | 1467 | The value of the "$ref" keyword MUST be a string which is a URI-Reference.
|
1464 | 1468 | 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. |
1467 | 1471 | </t>
|
1468 | 1472 | </section>
|
1469 | 1473 |
|
1470 | 1474 | <section title='Dynamic References with "$dynamicRef"' anchor="dynamic-ref">
|
1471 | 1475 | <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. |
1474 | 1479 | </t>
|
1475 | 1480 | <t>
|
1476 | 1481 | Together with "$dynamicAnchor", "$dynamicRef" implements a cooperative
|
1477 | 1482 | extension mechanism that is primarily useful with recursive schemas
|
1478 | 1483 | (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". |
1481 | 1487 | </t>
|
1482 | 1488 | <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. |
1487 | 1493 | </t>
|
1488 | 1494 | <t>
|
1489 | 1495 | If the initially resolved starting point URI includes a fragment that
|
|
1493 | 1499 | an identically named fragment with "$dynamicAnchor".
|
1494 | 1500 | </t>
|
1495 | 1501 | <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. |
1498 | 1504 | </t>
|
1499 | 1505 | <t>
|
1500 | 1506 | For a full example using these keyword, see appendix
|
|
0 commit comments