stefankoegl / python-json-patch

Applying JSON Patches in Python
https://python-json-patch.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
459 stars 97 forks source link

jsondiff 1.20 includes extraneous 'value' field for remove operation #76

Closed ostackbrian closed 6 years ago

ostackbrian commented 6 years ago

This was detected by openstack/python-glanceclient unit tests. Here's a command line example:

$ cat has-friend.json { "name": "fred", "friend": "barney", "spouse": "betty" } $ cat no-friend.json { "name": "fred", "spouse": "betty" }

$ jsondiff --version jsondiff 1.20 $ jsondiff has-friend.json no-friend.json [{"path": "/friend", "value": "barney", "op": "remove"}]

$ /usr/local/bin/jsondiff --version jsondiff 1.16 $ /usr/local/bin/jsondiff has-friend.json no-friend.json [{"path": "/friend", "op": "remove"}]

My reading of https://tools.ietf.org/html/rfc6902#section-4.2 is the 1.16 version is correct.

ostackbrian commented 6 years ago

See pull request #77.

stefankoegl commented 6 years ago

77 has been merged, and version 1.21 has been released with this fix.

Thanks!