Skip to content
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

NSNUmber is converting to Bool #77

Open
filipepereira-ag opened this issue May 24, 2023 · 0 comments
Open

NSNUmber is converting to Bool #77

filipepereira-ag opened this issue May 24, 2023 · 0 comments

Comments

@filipepereira-ag
Copy link

When dictionary contains an NSNumber as 0 or 1, encodable method is mapping to true or false because 0 or 1 is also a boolean for swift.

I think this bug was introduced in #69 because NSNumber condition was removed from the first switch statement.

Example:

var dictionary = [
     "int": NSNumber(0)
] 

AnyEncodable is returning ["int": false].
This problem only happens from version 0.6.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant