Skip to content

Commit

Permalink
Add ordering readme.md and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
kindly committed Nov 22, 2017
1 parent 537d177 commit 50b9ba6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ print(result)
# {'a': 2, 'b': 3}
```


Create Patch example
```
Expand All @@ -60,6 +61,20 @@ print(patch)
# {'a': 2, 'b': 3}
```

Merge example preserving order. Inputs need to be OrderedDicts. Will error otherwise.
Argument "position" can either be 'first', 'last'.

```
import json_merge_patch
input1 = OrderedDict([("a", 1)])
input2 = OrderedDict([("a", 1), ("b", 3)])
result = json_merge_patch.merge(input1, input2, position="first")
print(result)
# {'b': 3, 'a': 2}
```

Usage as a command line tool
----------------------------

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup
setup(name='json-merge-patch',
version='0.1',
version='0.2',
description='JSON Merge Patch library (https://tools.ietf.org/html/rfc7386)',
author='David Raznick',
author_email='[email protected]',
Expand Down

0 comments on commit 50b9ba6

Please sign in to comment.