Skip to content

Commit

Permalink
Changing previous type comparison to just comparing how json.dumps re…
Browse files Browse the repository at this point in the history
…nders 2 values.

This avoids flagging mismatches between classes which happen to be different but which are JSONified as the same thing.
  • Loading branch information
Jonathan Hilliard committed Jan 28, 2020
1 parent 028089d commit 97e18f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jsonpatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ def _compare_values(self, path, key, src, dst):
isinstance(dst, MutableSequence):
self._compare_lists(_path_join(path, key), src, dst)

elif src == dst and type(src) == type(dst):
elif json.dumps(src) == json.dumps(dst):
return

else:
Expand Down

0 comments on commit 97e18f3

Please sign in to comment.