Closed slvs closed 9 years ago
I assume the JsonPatch expects json that looks like [{"op": "add", "path": "/id", "value": 1}]. Described at: https://tools.ietf.org/html/rfc6902
Maybe you are thinking of JsonMergePatch? https://tools.ietf.org/html/rfc7386
Which uses the JsonMergePatch.fromJson function.
Exactly what @jhuffaker said; here you are trying to use a JSON Merge Patch, not a JSON Patch.
I'm using json-patch-1.9, and the following simple code doesn't work:
The call to JsonPatch.fromJson(newNode) throws the following exception:
com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of FIELD_NAME token
Any idea what is wrong?