Skip to content

Commit 6cd5acd

Browse files
authored
Merge pull request #1400 from handrews/relptr-more-fixes
Updates for Relative JSON Pointer
2 parents efbb965 + c327b19 commit 6cd5acd

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

relative-json-pointer.xml

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<?rfc rfcedstyle="yes"?>
1313
<?rfc comments="yes"?>
1414
<?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">
1616
<front>
1717
<title abbrev="Relative JSON Pointers">Relative JSON Pointers</title>
1818

@@ -83,35 +83,31 @@
8383
<t>
8484
A Relative JSON Pointer is a Unicode string in UTF-8 encoding (see RFC 8259,
8585
<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>).
8889
</t>
8990
<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
9193
always be unambiguous, because a JSON Pointer must be either zero-
9294
length or start with a '/' (%x2F). Similarly, a JSON Pointer will
9395
never be ambiguous with the '#'.
9496
</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 &lt;json-pointer&gt; follows the production defined in
110-
<xref target="RFC6901">RFC 6901, Section 3</xref> ("Syntax").
111-
</postamble>
112-
</figure>
11397
<t>
98+
The ABNF syntax of a Relative JSON Pointer is:
11499
</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>
115111
</section>
116112

117113
<section title="Evaluation">
@@ -203,7 +199,7 @@
203199
<artwork>
204200
<![CDATA[
205201
{
206-
"foo": ["bar", "baz"],
202+
"foo": ["bar", "baz", "biz"],
207203
"highly": {
208204
"nested": {
209205
"objects": true
@@ -225,7 +221,7 @@
225221
"0-1" "bar"
226222
"2/highly/nested/objects" true
227223
"0#" 1
228-
"0-1#" 0
224+
"0+1#" 2
229225
"1#" "foo"
230226
]]>
231227
</artwork>
@@ -329,6 +325,12 @@
329325
</t>
330326
<t>
331327
<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>
332334
<t hangText="draft-bhutton-relative-json-pointer-00">
333335
<list style="symbols">
334336
<t>Add array forward and backward index manipulation</t>

0 commit comments

Comments
 (0)