@@ -138,9 +138,10 @@ Table of Contents
138
138
139
139
A patch with empty contents corresponds to deletion of existing
140
140
content at the specified range. A patch with a zero-length range but
141
- non-empty contents corresponds to inserting content at a location. A
142
- patch with non-empty contents at a non-zero-length range corresponds
143
- to replacing existing content at the range with new content.
141
+ non-empty contents corresponds to inserting content immediately
142
+ before the location of the zero-length range. A patch with non-empty
143
+ contents at a non-zero-length range corresponds to replacing existing
144
+ content at the range with new content.
144
145
145
146
When server supports Range header with non-GET requests, server MUST
146
147
NOT ignore the Range header when used with a non-GET request. When
@@ -265,14 +266,20 @@ Table of Contents
265
266
token CAN be compromised of two sets of digits (according to the
266
267
ABNF syntax for array indices as specified in Section 4 of
267
268
[RFC6901]), delimited by a character "-". Each set of digits
268
- represent an unsigned base-10 integer value. The second integer
269
- value MUST be strictly larger than the first integer value,
270
- otherwise an error condition is raised. The new referenced value
271
- is a new array with a subset of elements starting at the zero-based
272
- index of the first integer value, and ending at the element before
273
- the zero-based index of the second integer value (the first index
274
- is inclusive, the second index is exclusive). The range cannot
275
- span non-existing array elements.
269
+ represent an unsigned base-10 integer value. The first integer
270
+ value MUST be smaller than the number of elements in the array,
271
+ except when it is equal to the second integer value and is equal to
272
+ the number of elements in the array. The second integer value MUST
273
+ be smaller than or equal to the number of elements in the array.
274
+ The second integer value MUST be larger than or equal to the first
275
+ integer value. If any of these requirements are violated, an error
276
+ condition is raised.
277
+
278
+ The new referenced value is a new array with a subset of elements
279
+ starting at the zero-based index of the first integer value, and
280
+ ending at the element before the zero-based index of the second
281
+ integer value (the first index is inclusive, the second index is
282
+ exclusive).
276
283
277
284
o If the currently referenced value is a JSON string, the scheme for
278
285
JSON arrays is used to index into a string and makes the new
@@ -299,12 +306,18 @@ Table of Contents
299
306
"/foo/0" "bar"
300
307
"/foo/0-1" ["bar"]
301
308
"/foo/1-3" ["baz", "bax"]
302
- "/foo/1-1" // error
309
+ "/foo/1-1" []
310
+ "/foo/3-3" []
311
+ "/foo/4-4" // error
303
312
"/foo/1-0" // error
304
313
"/foo/1-4" // error
305
314
"/foo/1-3/0" // error
306
315
"/foo/0/1-3" "ar"
307
316
317
+ JSON ranges "/foo/1-1" and "/foo/3-3" are on its own of little
318
+ utility, but serve as a zero-length range to identify a location
319
+ immediately before which new content can be inserted with a patch.
320
+
308
321
4. IANA Considerations
309
322
310
323
4.1. Range Unit Registration
0 commit comments