-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comparison fails if the key on the left side has an array value while the right side has null
value
#15
Comments
…is not an array instead of trying to compare the length and failing if one of the values is null.
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:
Right side:
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:
{ "akey": [] }
Right side:
The text was updated successfully, but these errors were encountered: