File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ print(result)
49
49
# {'a': 2, 'b': 3}
50
50
```
51
51
52
+
52
53
Create Patch example
53
54
```
54
55
@@ -60,6 +61,20 @@ print(patch)
60
61
# {'a': 2, 'b': 3}
61
62
```
62
63
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
+
63
78
Usage as a command line tool
64
79
----------------------------
65
80
Original file line number Diff line number Diff line change 1
1
from setuptools import setup
2
2
setup (name = 'json-merge-patch' ,
3
- version = '0.1 ' ,
3
+ version = '0.2 ' ,
4
4
description = 'JSON Merge Patch library (https://tools.ietf.org/html/rfc7386)' ,
5
5
author = 'David Raznick' ,
6
6
author_email = 'mr.raznick@gmail.com' ,
You can’t perform that action at this time.
0 commit comments