Skip to content

Commit 50b9ba6

Browse files
committed
Add ordering readme.md and bump version
1 parent 537d177 commit 50b9ba6

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ print(result)
4949
# {'a': 2, 'b': 3}
5050
```
5151

52+
5253
Create Patch example
5354
```
5455
@@ -60,6 +61,20 @@ print(patch)
6061
# {'a': 2, 'b': 3}
6162
```
6263

64+
Merge example preserving order. Inputs need to be OrderedDicts. Will error otherwise.
65+
Argument "position" can either be 'first', 'last'.
66+
67+
```
68+
import json_merge_patch
69+
70+
input1 = OrderedDict([("a", 1)])
71+
input2 = OrderedDict([("a", 1), ("b", 3)])
72+
73+
result = json_merge_patch.merge(input1, input2, position="first")
74+
print(result)
75+
# {'b': 3, 'a': 2}
76+
```
77+
6378
Usage as a command line tool
6479
----------------------------
6580

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import setup
22
setup(name='json-merge-patch',
3-
version='0.1',
3+
version='0.2',
44
description='JSON Merge Patch library (https://tools.ietf.org/html/rfc7386)',
55
author='David Raznick',
66
author_email='mr.raznick@gmail.com',

0 commit comments

Comments
 (0)