-
Couldn't load subscription status.
- Fork 88
Description
This is a suggestion. I spent an inordinate amount of time, with and without the help of AI trying to figure out why my identical JSON objects are returning a diff only when I run it in my application and not when I am testing it.
I tested by saving the JSONs during dev runtime and loading them and diffing.
I finally realized, it is because jsondiff is okay accepting Python objects that are not JSONs and thereby, producing a diff. But when I json.dumps(json.loads(obj)), it works, because now I have a legit JSON.
Since this project is called jsondiff I highly suggest including this conversion when accepting Python dictionaries. Or, at least, providing a parameter to diff to do that conversion and calling it out in documentation. The only hint I could find, in hind-sight, is the keyword "JSON-like" in the repository.
'Explicit is better than implicit'