Skip to content

Commit 096d46d

Browse files
author
Mike McCabe
committed
0 can be an array index or object element name. Fixes #2
1 parent a27a73c commit 096d46d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@
9090
"patch": [{"op": "add", "path": "/bar", "value": null}],
9191
"expected": {"foo": 1, "bar": null} },
9292

93-
{ "doc": {"foo": 1},
93+
{ "comment": "0 can be an array index or object element name",
94+
"doc": {"foo": 1},
9495
"patch": [{"op": "add", "path": "/0", "value": "bar"}],
95-
"error": "Array operation on object target" },
96+
"expected": {"foo": 1, "0": "bar" } },
9697

9798
{ "doc": ["foo"],
9899
"patch": [{"op": "add", "path": "/1", "value": "bar"}],

0 commit comments

Comments
 (0)