I\'m looking for a practical guide to implementing the PATCH
verb for partial updates of a noun in a RESTful api using JSON. Understanding that PATCH
i
The spec clearly details how to format the JSON body of a PATCH request. You're using a totally different format. Given that, I'm not surprised at all that there is ambiguity. The body should look something like:
[
{ "op": "replace", "path": "/name", "value": "SimpleGuy" },
{ "op": "add", "path": "/email", "value": "hey@google.com" },
{ "op": "replace", "path": "/city", "value": null },
{ "op": "replace", "path": "/roles", "value": [ "owner" ] },
{ "op": "add", "path": "/posts/02/title", "value": "how to pop lock" },
{ "op": "add", "path": "/posts/", "value": "03" },
{ "op": "add", "path": "/posts/03/title", "value": "how to salsa" },
{ "op": "add", "path": "/notes", "value": { "title": "a note title" } }
]
Go back and read the spec. It even gives examples which address most of your questions.