json-patch / json-patch-tests

Tests for implementations of json-patch
68 stars 21 forks source link

removing a nonexistent field should fail #32

Closed norpan closed 7 years ago

norpan commented 7 years ago
4.2.  remove

   The "remove" operation removes the value at the target location.

   The target location MUST exist for the operation to be successful.

so

    { "comment": "For remove, the target location MUST exist for the operation to be successful.",
      "doc": {"foo" : "bar"},
      "patch": [{"op": "remove", "path": "/baz"}],
      "error": "removing a nonexistent field should fail" }
norpan commented 7 years ago

The same goes for removing a too large array index.

bruth commented 7 years ago

Good observation. Can you submit a PR adding that test case?

norpan commented 7 years ago

33