jsonyx.apply_patch

jsonyx.apply_patch(obj, patch, *, allow=NOTHING)[source]

Apply a JSON patch to a Python object.

Added in version 2.0.

Changed in version 2.4: Removed use_decimal.

Parameters:
Raises:
Returns:

Any – the patched Python object

Example:
>>> import jsonyx as json
>>> json.apply_patch([1, 2, 3], {"op": "del", "path": "$[1]"})
[1, 3]

Tip

See also

jsonyx.make_patch() for making a patch.