Skip to content

Commit 99264bb

Browse files
authored
Merge pull request #37 from FormAPI/missing_parent_key
Added a test case to check "replace" op with a missing parent key
2 parents 0dd0fbc + c2fae3a commit 99264bb

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
@@ -202,6 +202,11 @@
202202
"patch": [{"op": "replace", "path": "", "value": {"baz": "qux"}}],
203203
"expected": {"baz": "qux"} },
204204

205+
{ "comment": "test replace with missing parent key should fail",
206+
"doc": {"bar": "baz"},
207+
"patch": [{"op": "replace", "path": "/foo/bar", "value": false}],
208+
"error": "replace op should fail with missing parent key" },
209+
205210
{ "comment": "spurious patch properties",
206211
"doc": {"foo": 1},
207212
"patch": [{"op": "test", "path": "/foo", "value": 1, "spurious": 1}],

0 commit comments

Comments
 (0)