Skip to content

Commit 97e18f3

Browse files
author
Jonathan Hilliard
committed
Changing previous type comparison to just comparing how json.dumps renders 2 values.
This avoids flagging mismatches between classes which happen to be different but which are JSONified as the same thing.
1 parent 028089d commit 97e18f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jsonpatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ def _compare_values(self, path, key, src, dst):
825825
isinstance(dst, MutableSequence):
826826
self._compare_lists(_path_join(path, key), src, dst)
827827

828-
elif src == dst and type(src) == type(dst):
828+
elif json.dumps(src) == json.dumps(dst):
829829
return
830830

831831
else:

0 commit comments

Comments
 (0)