mirror of
https://github.com/json-c/json-c.git
synced 2026-09-07 16:46:50 +08:00
reject null op/path/from fields in json_patch_apply
This commit is contained in:
@@ -542,6 +542,18 @@
|
||||
"patch": [{"op": "copy", "from": "/a", "path": "/b"},
|
||||
{"op": "copy", "from": "/b", "path": "/a/p/x"}],
|
||||
"expected": {"a": {"p": {"x": {"p": {}}}}, "b": {"p": {}}}
|
||||
},
|
||||
|
||||
{ "comment": "null op field must be rejected, not dereferenced",
|
||||
"doc": {"foo": "bar"},
|
||||
"patch": [{"op": null, "path": "/foo"}],
|
||||
"error": "a null op field should fail rather than crash"
|
||||
},
|
||||
|
||||
{ "comment": "null from field must be rejected, not dereferenced",
|
||||
"doc": {"foo": "bar"},
|
||||
"patch": [{"op": "move", "from": null, "path": "/foo"}],
|
||||
"error": "a null from field should fail rather than crash"
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user