inveniosoftware / inveniosoftware/dictdiffer
Wrong patch format WRT the standard RFC 6902
- Dominant language
- Python
- Stars
- 849
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
This is the test that I run
``` python
self.root= {}
self.head= {'foo': 'baz1'}
self.update= {'foo': 'baz2'}
non_list_merger = Merger(self.root, self.head, self.update, {})
try:
non_list_merger.run()
except UnresolvedConflictsException as e:
print(e.content)
```
This is the result of the previous code:
``` Python
[Conflict(('add', '', [('foo', 'baz1')]), ('add', '', [('foo', 'baz2')]))]
```
In according to the standard RFC 6902 that defines: a JSON document structure for expressing sequence of operations to apply to a JavaScript Object Notation (JSON) document; (https://tools.ietf.org/html/rfc6902)
IMHO the result is wrong for 2 reasons:
1. It is not wrapped in an object (but is a minor issue, tuples are fine)
2. The format of the response is wrong because is not returning the key `foo` in the right place. This force users to handle different cases and build manually the path for a given patch.
Contributor guide
Assessment
This issue has not been assessed yet.