Skip to content

Commit 9519ccf

Browse files
committed
Merge branch 'master' of github.com:json-patch/json-patch-tests
2 parents a79034a + 096d46d commit 9519ccf

File tree

2 files changed

+5
-32
lines changed

2 files changed

+5
-32
lines changed

simplexml_tests.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

tests.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
"patch": [],
2525
"expected": {"foo":{"bar":2, "foo": 1}} },
2626

27-
{ "comment": "add to existing null-valued field should err",
27+
{ "comment": "add replaces any existing field",
2828
"doc": {"foo": null},
2929
"patch": [{"op": "add", "path": "/foo", "value":1}],
30-
"error": "'add' target already set" },
30+
"expected": {"foo": 1} },
3131

3232
{ "comment": "toplevel array",
3333
"doc": [],
@@ -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)