Closed SmartManoj closed 5 years ago
base = { "foo": 1, "bar": ["2"] } head = { "bar": ["2"], "baz": "Hello, world!" } schema = { "properties": { "bar": { "uniqueItems": True, "mergeStrategy": "append", } } } from jsonmerge import Merger from pprint import * merger = Merger(schema) result = merger.merge(base, head) pprint(result, width=40) {'bar': ['2'], 'baz': 'Hello, world!', 'foo': 1}