Patch

March 21, 2025 ยท View on GitHub

The JSON patch object to apply partial updates to resources.

Structure

Patch

Fields

NameTypeTagsDescriptionGetterSetter
OpPatchOpRequiredThe operation.PatchOp getOp()setOp(PatchOp op)
PathStringOptionalThe JSON Pointer to the target document location at which to complete the operation.String getPath()setPath(String path)
ValueJsonValueOptionalThe value to apply. The remove, copy, and move operations do not require a value. Since JSON Patch allows any type for value, the type property is not specified.JsonValue getValue()setValue(JsonValue value)
FromStringOptionalThe JSON Pointer to the target document location from which to move the value. Required for the move operation.String getFrom()setFrom(String from)

Example (as JSON)

{
  "op": "add",
  "path": "path6",
  "value": {
    "key1": "val1",
    "key2": "val2"
  },
  "from": "from0"
}