|
12 | 12 | <?rfc rfcedstyle="yes"?>
|
13 | 13 | <?rfc comments="yes"?>
|
14 | 14 | <?rfc inline="yes" ?>
|
15 |
| -<rfc category="info" docName="draft-bhutton-relative-json-pointer-00" ipr="trust200902" submissionType="IETF"> |
| 15 | +<rfc category="info" docName="draft-handrews-relative-json-pointer-03" ipr="trust200902" submissionType="IETF"> |
16 | 16 | <front>
|
17 | 17 | <title abbrev="Relative JSON Pointers">Relative JSON Pointers</title>
|
18 | 18 |
|
|
83 | 83 | <t>
|
84 | 84 | A Relative JSON Pointer is a Unicode string in UTF-8 encoding (see RFC 8259,
|
85 | 85 | <xref target="RFC8259">Section 8</xref>), comprising a non-negative integer,
|
86 |
| - followed by either a '#' (%x23) character or a JSON Pointer |
87 |
| - (<xref target="RFC6901">RFC 6901</xref>). |
| 86 | + an optional index adjustment consisting of '+' (%x2B) or '-' (%x2D) followed |
| 87 | + by a positive integer, followed by either a '#' (%x23) character or |
| 88 | + a JSON Pointer (<xref target="RFC6901">RFC 6901</xref>). |
88 | 89 | </t>
|
89 | 90 | <t>
|
90 |
| - The separation between the integer prefix and the JSON Pointer will |
| 91 | + The separation between the integer prefix (with optional adjustment) |
| 92 | + and the JSON Pointer will |
91 | 93 | always be unambiguous, because a JSON Pointer must be either zero-
|
92 | 94 | length or start with a '/' (%x2F). Similarly, a JSON Pointer will
|
93 | 95 | never be ambiguous with the '#'.
|
94 | 96 | </t>
|
95 |
| - <figure align="center"> |
96 |
| - <preamble> |
97 |
| - The ABNF syntax of a Relative JSON Pointer is: |
98 |
| - </preamble> |
99 |
| - <artwork> |
100 |
| -<![CDATA[ |
101 |
| - relative-json-pointer = non-negative-integer [index-manipulation] <json-pointer> |
102 |
| - relative-json-pointer =/ non-negative-integer "#" |
103 |
| - index-manipulation = ("+" / "-") non-negative-integer |
104 |
| - non-negative-integer = %x30 / %x31-39 *( %x30-39 ) |
105 |
| - ; "0", or digits without a leading "0" |
106 |
| -]]> |
107 |
| - </artwork> |
108 |
| - <postamble> |
109 |
| - where <json-pointer> follows the production defined in |
110 |
| - <xref target="RFC6901">RFC 6901, Section 3</xref> ("Syntax"). |
111 |
| - </postamble> |
112 |
| - </figure> |
113 | 97 | <t>
|
| 98 | + The ABNF syntax of a Relative JSON Pointer is: |
114 | 99 | </t>
|
| 100 | + <sourcecode type="abnf9110"><![CDATA[ |
| 101 | + relative-json-pointer = origin-specification json-pointer |
| 102 | + / origin-specification "#" |
| 103 | + ; json-pointer from RFC 6901 |
| 104 | +
|
| 105 | + origin-specification = non-negative-integer [ index-manipulation ] |
| 106 | + index-manipulation = ( "+" / "-" ) positive-integer |
| 107 | + non-negative-integer = "0" / positive-integer |
| 108 | + positive-integer = %x31-39 *DIGIT |
| 109 | + ; digits without a leading zero |
| 110 | +]]></sourcecode> |
115 | 111 | </section>
|
116 | 112 |
|
117 | 113 | <section title="Evaluation">
|
|
203 | 199 | <artwork>
|
204 | 200 | <![CDATA[
|
205 | 201 | {
|
206 |
| - "foo": ["bar", "baz"], |
| 202 | + "foo": ["bar", "baz", "biz"], |
207 | 203 | "highly": {
|
208 | 204 | "nested": {
|
209 | 205 | "objects": true
|
|
225 | 221 | "0-1" "bar"
|
226 | 222 | "2/highly/nested/objects" true
|
227 | 223 | "0#" 1
|
228 |
| - "0-1#" 0 |
| 224 | + "0+1#" 2 |
229 | 225 | "1#" "foo"
|
230 | 226 | ]]>
|
231 | 227 | </artwork>
|
|
329 | 325 | </t>
|
330 | 326 | <t>
|
331 | 327 | <list style="hanging">
|
| 328 | + <t hangText="draft-handrews-relative-json-pointer-03"> |
| 329 | + <list style="symbols"> |
| 330 | + <t>Fix ABNF omission for using # with index manipulation</t> |
| 331 | + <t>Clarify handling of leading "0"</t> |
| 332 | + </list> |
| 333 | + </t> |
332 | 334 | <t hangText="draft-bhutton-relative-json-pointer-00">
|
333 | 335 | <list style="symbols">
|
334 | 336 | <t>Add array forward and backward index manipulation</t>
|
|
0 commit comments