Skip to content

Commit f29a364

Browse files
committed
Support appending.
See #29.
1 parent 669d7fd commit f29a364

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

draft-xx-httpbis-range-patch-00.txt

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -275,22 +275,26 @@ Table of Contents
275275
o If the currently referenced value is a JSON array, the reference
276276
token CAN be compromised of two sets of digits (according to the
277277
ABNF syntax for array indices as specified in Section 4 of
278-
[RFC6901]), delimited by a character "-". Each set of digits
278+
[RFC6901]), delimited by the character "-". Each set of digits
279279
represent an unsigned base-10 integer value. The first integer
280-
value MUST be smaller than the number of elements in the array,
281-
except when it is equal to the second integer value and is equal to
282-
the number of elements in the array. The second integer value MUST
283-
be smaller than or equal to the number of elements in the array.
284-
The second integer value MUST be larger than or equal to the first
285-
integer value. If any of these requirements are violated, an error
286-
condition is raised.
280+
value MUST be smaller than the number of elements in the array. The
281+
second integer value MUST be smaller than or equal to the number of
282+
elements in the array. The second integer value MUST be larger than
283+
or equal to the first integer value. If any of these requirements
284+
are violated, an error condition is raised.
287285

288286
The new referenced value is a new array with a subset of elements
289287
starting at the zero-based index of the first integer value, and
290288
ending at the element before the zero-based index of the second
291289
integer value (the first index is inclusive, the second index is
292290
exclusive).
293291

292+
o If the currently referenced value is a JSON array, the reference
293+
token CAN be the character "-". The new referenced value is a
294+
zero-length array corresponding to the position immediately after
295+
the end of the current array. This design makes such JSON pointer
296+
compatible with the use of JSON pointers in JSON Patch [RFC6902].
297+
294298
o If the currently referenced value is a JSON string, the scheme for
295299
JSON arrays is used to index into a string and makes the new
296300
referenced value a substring of the currently referenced value.
@@ -317,16 +321,17 @@ Table of Contents
317321
"/foo/0-1" ["bar"]
318322
"/foo/1-3" ["baz", "bax"]
319323
"/foo/1-1" []
320-
"/foo/3-3" []
324+
"/foo/-" []
325+
"/foo/3-3" // error
321326
"/foo/4-4" // error
322327
"/foo/1-0" // error
323328
"/foo/1-4" // error
324329
"/foo/1-3/0" // error
325330
"/foo/0/1-3" "ar"
326331

327-
JSON ranges "/foo/1-1" and "/foo/3-3" are on its own of little
328-
utility, but serve as a zero-length range to identify a location
329-
immediately before which new content can be inserted with a patch.
332+
JSON ranges "/foo/1-1" and "/foo/-" are on its own of little utility,
333+
but serve as a zero-length range to identify a location immediately
334+
before which new content can be inserted with a patch.
330335

331336
3.3. Lines Range Unit
332337

@@ -480,6 +485,9 @@ Table of Contents
480485
[RFC6901] Bryan, P., Zyp, K., and M. Nottingham, "JavaScript Object
481486
Notation (JSON) Pointer", RFC 6901, April 2013.
482487

488+
[RFC6902] Bryan, P., and M. Nottingham, "JavaScript Object Notation
489+
(JSON) Patch", RFC 6902, April 2013.
490+
483491
8.2. Informative References
484492

485493
[RFC8259] T. Bray, "The JavaScript Object Notation (JSON) Data

0 commit comments

Comments
 (0)