Skip to content

Commit f3ebba0

Browse files
committed
Added test for a whole document replacement patch
- Discovered python-json-patch had a problem with this scenario and other implentations might as well
1 parent 85819b6 commit f3ebba0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@
171171
"expected": ["foo", ["bar", "baz"]],
172172
"comment": "value in array replace not flattened" },
173173

174+
{ "comment": "replace whole document",
175+
"doc": {"foo": "bar"},
176+
"patch": [{"op": "replace", "path": "", "value": {"baz": "qux"}}],
177+
"expected": {"baz": "qux"} },
178+
174179
{ "comment": "spurious patch properties",
175180
"doc": {"foo": 1},
176181
"patch": [{"op": "test", "path": "/foo", "value": 1, "spurious": 1}],

0 commit comments

Comments
 (0)