RFC6902
Diff
/_posts/0/titleREPLACE
Previous:
"Hello world!"
New:
"Hello world..."
/_posts/-ADD
Added:
{
"id": 2,
"title": "Hello world! Again!"
}/_drafts/0REMOVE
Removed:
{
"id": 2,
"title": "Hello world! Again!"
}Complete Patch
[
{
"op": "replace",
"path": "/_posts/0/title",
"value": "Hello world..."
},
{
"op": "add",
"path": "/_posts/-",
"value": {
"id": 2,
"title": "Hello world! Again!"
}
},
{
"op": "remove",
"path": "/_drafts/0"
}
]About RFC6902
RFC6902 defines a JSON Patch format for expressing a sequence of operations to apply to a JSON document. The patch operations include:
add- Add a value to an object or insert into an array
remove- Remove a value from an object or array
replace- Replace a value
move- Move a value from one location to another
copy- Copy a value from one location to another
test- Test that a value at a location equals a specified value
References
- RFC 6902 Specification : Official JSON Patch specification
- rfc6902 JavaScript Library: The library used to generate patches on this page