Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

NSNUmber is converting to Bool #77

Open
filipepereira-ag opened this issue May 24, 2023 · 1 comment
Open

NSNUmber is converting to Bool #77

filipepereira-ag opened this issue May 24, 2023 · 1 comment

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.

@pedrommcarrasco
Copy link

I'm running into the same issue

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

No branches or pull requests

2 participants