diff --git a/v5/patch_test.go b/v5/patch_test.go index fbcb5ae..20d90cd 100644 --- a/v5/patch_test.go +++ b/v5/patch_test.go @@ -578,6 +578,13 @@ var Cases = []Case{ false, false, }, + { + `{}`, + `[{"op": "replace", "path": "", "value": null}]`, + `null`, + false, + false, + }, } type BadCase struct { @@ -732,6 +739,11 @@ var BadCases = []BadCase{ `[{"op": "replace", "path": "/foo/bar", "value": null}, {"op": "add", "path": "/foo/bar/0", "value": "blah"}]`, false, }, + { + `{}`, + `[{"op": "replace", "path": ""}]`, + true, + }, } // This is not thread safe, so we cannot run patch tests in parallel.