Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nineteendo committed Aug 20, 2024
1 parent 9ecb6e7 commit 1f41ad4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ Decoding JSON::
...
['filesystem API']

Making a patch::

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

Applying a patch::

>>> import jsonyx as json
Expand Down
3 changes: 3 additions & 0 deletions src/jsonyx/_differ.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,6 @@ def make_patch(old: Any, new: Any) -> list[dict[str, Any]]:
patch: list[dict[str, Any]] = []
_make_patch(old, new, patch)
return patch


make_patch.__module__ = "jsonyx"

0 comments on commit 1f41ad4

Please sign in to comment.