mirror of
https://github.com/json-c/json-c.git
synced 2026-09-07 08:36:50 +08:00
require string type for patch op/path/from fields
This commit is contained in:
@@ -554,6 +554,12 @@
|
||||
"doc": {"foo": "bar"},
|
||||
"patch": [{"op": "move", "from": null, "path": "/foo"}],
|
||||
"error": "a null from field should fail rather than crash"
|
||||
},
|
||||
|
||||
{ "comment": "null path field must be rejected, not dereferenced",
|
||||
"doc": {"foo": "bar"},
|
||||
"patch": [{"op": "remove", "path": null}],
|
||||
"error": "a null path field should fail rather than crash"
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
@@ -161,3 +161,5 @@ Testing 'null op field must be rejected, not dereferenced', doc '{ "foo": "bar"
|
||||
=> json_patch_apply failed as expected: ERRNO=EINVAL at patch idx 0: Patch object 'op' field is not a string
|
||||
Testing 'null from field must be rejected, not dereferenced', doc '{ "foo": "bar" }' patch '[ { "op": "move", "from": null, "path": "\/foo" } ]' : OK
|
||||
=> json_patch_apply failed as expected: ERRNO=EINVAL at patch idx 0: Patch object 'from' field is not a string
|
||||
Testing 'null path field must be rejected, not dereferenced', doc '{ "foo": "bar" }' patch '[ { "op": "remove", "path": null } ]' : OK
|
||||
=> json_patch_apply failed as expected: ERRNO=EINVAL at patch idx 0: Patch object 'path' field is not a string
|
||||
|
||||
Reference in New Issue
Block a user