What is the standard outcome of the following 'remove' JSON Patch with an empty ""
path?
[{ "op": "remove", "path": ""}]
Should it clear the whole object, equal to assigning {}
? In http://jsonpatch.com/ it says: To point to the root of the document use an empty string for the pointer. So I guess a 'remove' on the root removes the whole object, right?
I tried it with two different JSON Patch libraries with two different results:
- https://github.com/java-json-tools/json-patch: deletes the whole object
- https://github.com/gnieh/diffson: throws an JsResultException
What is the officially accepted, standard outcome of this? I checked in the RFC for the JSON Patch (https://www.rfc-editor.org/rfc/rfc6902) but couldn't find anything.