jsonyx.make_patch

jsonyx.make_patch(old, new)

Make a JSON patch from two Python objects.

Added in version 2.0.

Parameters:
  • old (Any) – the old Python object

  • new (Any) – the new Python object

Raises:

RecursionError – if the object is too deeply nested

Returns:

list[_Operation] – the JSON patch

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