Closed richardsavio closed 6 years ago
Thank you very much for this bug. Commit 3f12041 should fix this issue. I've always updated the unit tests to catch this problem in both directions. I want to do a little more testing before I push this out to jsondiff.com.
I've finished my testing and updated jsondiff.com. This should be all set. Thanks again for the bug report.
@zgrossbart A similar issue occurs for objects/dictionaries. Should I open a separate bug report?
Example: Left side:
{ "akey": {} }
Right side:
{ "akey": null }
And thank you for fixing it so quickly. I use jsondiff quite often at work and I really appreciate all the work you put into the site.
No need for a new bug. I'll just reopen this one.
I'm really glad the site is useful. Change c86af7c should fix the issue for objects as well. I've added new unit tests for that case too. I'll do a little more testing and then update jsondiff.com.
All tests have passed and I've updated jsondiff.com. This issue should be all set.
The comparison fails when the value for a key on the left side is an array and the value for the same key on the right is
null
. Might also fail for other comparisons where the type on the right does not have a length attribute. Haven't checked that.It works fine if you switch sides. That is, put the JSON for the left side in the example below on the right and vice versa.
An example: Left side:
Right side: