|
310 | 310 | or schema keywords. Broadly speaking, keywords fall into one
|
311 | 311 | of four categories:
|
312 | 312 | <list style="hanging">
|
| 313 | + <t hangText="identifiers:"> |
| 314 | + control schema identification through setting the schema's |
| 315 | + canonical URI and/or changing how the base URI is determined |
| 316 | + </t> |
313 | 317 | <t hangText="assertions:">
|
314 | 318 | produce a boolean result when applied to an instance
|
315 | 319 | </t>
|
|
704 | 708 | document.
|
705 | 709 | </t>
|
706 | 710 | </section>
|
| 711 | + <section title="Identifiers" anchor="identifiers"> |
| 712 | + <t> |
| 713 | + Identifiers set the canonical URI of a schema, or affect how such URIs are |
| 714 | + resolved in <xref target="references">references</xref>, or both. |
| 715 | + The Core vocabulary defined in this document defines several |
| 716 | + identifying keywords, most notably "$id". |
| 717 | + </t> |
| 718 | + <t> |
| 719 | + Canonical schema URIs MUST NOT change while processing an instance, but |
| 720 | + keywords that affect URI-reference resolution MAY have behavior that |
| 721 | + is only fully determined at runtime. |
| 722 | + </t> |
| 723 | + <t> |
| 724 | + While custom identifier keywords are possible, vocabulary designers should |
| 725 | + take care not to disrupt the functioning of core keywords. For example, |
| 726 | + the "$recursiveAnchor" keyword in this specification limits its URI resolution |
| 727 | + effects to the matching "$recursiveRef" keyword, leaving "$ref" undisturbed. |
| 728 | + </t> |
| 729 | + </section> |
707 | 730 | <section title="Applicators" anchor="applicators">
|
708 | 731 | <t>
|
709 | 732 | Applicators allow for building more complex schemas than can be accomplished
|
|
1509 | 1532 | without requiring JSON Pointer references to be updated.
|
1510 | 1533 | </t>
|
1511 | 1534 | <t>
|
1512 |
| - The "$anchor" keyword is used to specify such a fragment. |
| 1535 | + The "$anchor" keyword is used to specify such a fragment. It is an |
| 1536 | + identifier keyword that can only be used to create plain name fragments. |
1513 | 1537 | </t>
|
1514 | 1538 | <t>
|
1515 | 1539 | If present, the value of this keyword MUST be a string, which MUST start with
|
|
1537 | 1561 | Several keywords can be used to reference a schema which is to be applied to the
|
1538 | 1562 | current instance location. "$ref" and "$recursiveRef" are applicator
|
1539 | 1563 | keywords, applying the referenced schema to the instance. "$recursiveAnchor"
|
1540 |
| - is a helper keyword that controls how the referenced schema of "$recursiveRef" |
1541 |
| - is determined. |
| 1564 | + is an identifier keyword that controls how the base URI for resolving |
| 1565 | + the URI-reference value of "$recursiveRef is determined. |
1542 | 1566 | </t>
|
1543 | 1567 | <t>
|
1544 |
| - As the value of "$ref" and "$recursiveRef" are URI References, this allows |
| 1568 | + As the values of "$ref" and "$recursiveRef" are URI References, this allows |
1545 | 1569 | the possibility to externalise or divide a schema across multiple files,
|
1546 | 1570 | and provides the ability to validate recursive structures through
|
1547 | 1571 | self-reference.
|
|
0 commit comments