wvteijlingen / Spine

A Swift library for working with JSON:API APIs. It supports mapping to custom model classes, fetching, advanced querying, linking and persisting.
MIT License
266 stars 109 forks source link

Supporting Bool while saving #153

Open sachin-sat opened 7 years ago

sachin-sat commented 7 years ago

While saving a resource with Bool value, it returns error(data type mismatch, my server expects bool value)from server.

let newObject = Person.init() newObject.is_american = true newObject.name = "King" spine.save(newObject)

the debug follows

{"data":{"type":"persons","attributes":{"name":"King","is_american =":"1"}}}

my server throws error due to this.

thanks in advance

wvteijlingen commented 7 years ago

Do you use an NSNumber variable and a BooleanAttribute? That should work.