Skip to content

Commit f008f49

Browse files
authored
Clarify status of negative indices
Fixes #47.
1 parent 2a928f9 commit f008f49

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@
9494
"patch": [{"op": "add", "path": "/bar/8", "value": "5"}],
9595
"error": "Out of bounds (upper)" },
9696

97-
{ "doc": {"bar": [1, 2]},
97+
{ "comment": "Negative index is evaluated as a path",
98+
"doc": {"bar": [1, 2]},
9899
"patch": [{"op": "add", "path": "/bar/-1", "value": "5"}],
99-
"error": "Out of bounds (lower)" },
100+
"error": "Negatives indices aren't valid" },
100101

101102
{ "doc": {"foo": 1},
102103
"patch": [{"op": "add", "path": "/bar", "value": true}],

0 commit comments

Comments
 (0)