|
669 | 669 | <xref target="I-D.luff-relative-json-pointer">Relative JSON Pointer</xref>,
|
670 | 670 | which is evaluated relative to the position in the instance from which
|
671 | 671 | <xref target="href">"href"</xref> template variable resolution would
|
672 |
| - normolly begin. |
| 672 | + normally begin. |
673 | 673 | </t>
|
674 | 674 | <t>
|
675 | 675 | For each property name in the object that matches a variable name in the
|
|
695 | 695 | "rel": "self",
|
696 | 696 | "href": "/trees{/root,parent,id}"
|
697 | 697 | "hrefPointers": {
|
| 698 | + "root": "/id", |
| 699 | + "parent": "2/id" |
| 700 | + } |
698 | 701 | }
|
699 | 702 | ]
|
700 | 703 | }]]>
|
|
703 | 706 | The self links here should always include the root node id,
|
704 | 707 | followed by an immediate parent id if one exists, and always ending
|
705 | 708 | with the id of the node that is the context of the self link.
|
| 709 | + The context node's id resolves with the standard process and |
| 710 | + does not appear in "hrefPointers". The root id is located |
| 711 | + using an absolute JSON Pointer, while the parent node |
| 712 | + uses a Relative JSON Pointer, going up two levels (one level up |
| 713 | + is the array of children, two levels up is the whole parent node). |
706 | 714 | </postamble>
|
707 | 715 | </figure>
|
708 | 716 | <figure>
|
|
728 | 736 | <t hangText='"" (the root node)'>/trees/0/0</t>
|
729 | 737 | <t hangText='"/children/0/children/0"'>/trees/0/0/1</t>
|
730 | 738 | <t hangText='"/children/0/children/0/children/0"'>/trees/0/1/2</t>
|
731 |
| - <t hangText='"/children/0/children/0/children/0/children/0"'>/trees/2/3</t> |
| 739 | + <t hangText='"/children/0/children/0/children/0/children/0"'>/trees/0/2/3</t> |
732 | 740 | </list>
|
733 |
| - omitted, giving us the desired URI with two components after "/trees". The |
734 | 741 | This shows the use of an absolute JSON Pointer to always resolve
|
735 | 742 | the root node from any depth, and a Relative JSON Pointer to always resolve
|
736 | 743 | the immediate parent, which cannot be identified with an absolute pointer.
|
|
0 commit comments