JSON-P 1.1 also introduced support for JSON Patch, another Internet Engineering Task Force standard, this one providing a series of operations that can be applied to a JSON document. JSON Patch allows us to perform partial updates on a JSON object.
The following operations are supported by JSON Patch:
JSON Patch Operation | Description |
| Adds an element to a JSON document. |
| Removes an element from a JSON document. |
| Replaces a value in a JSON document with a new value. |
| Moves a value in a JSON document from its current location in the document to a new position. |
| Copies a value in a JSON document to a new location in the document. |
| Verifies that the value in a specific location in a JSON document is equal to the specified value. |
JSON-P supports all of the preceding JSON Patch operations, which rely on JSON Pointer expressions to locate the source and target locations in JSON documents.
The following example illustrates how we can use JSON Patch with JSON-P 1.1:
package...