mgholam / fastJSON

Smallest, fastest polymorphic JSON serializer
https://www.codeproject.com/Articles/159450/fastJSON-Smallest-Fastest-Polymorphic-JSON-Seriali
MIT License
479 stars 147 forks source link

Make bool parse to accept integer values (0 and 1 (or other non-zero)). #80

Closed AgentFire closed 6 years ago

AgentFire commented 6 years ago

This data:

{
    "is_verified": 0,
    "has_issues": 1
}

Cannot be deserialized into an object with bool fields (is_verified and has_issues respectively), instead, it throws "Invalid cast" exception without any explanation.

I would like it to be less strict concerning such issues and convert zero to false and non-zero values to true if a target field has the bool type.

mgholam commented 6 years ago

fixed in v2.1.33