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
264 stars 109 forks source link

Serialize error for array of Doubles #125

Closed garySWARM closed 7 years ago

garySWARM commented 7 years ago

Hi, the latest version of the library is corrupting a location value, which is defined as: var location : [Double]? and should be serialized as "location":[-73.9599,40.72087] instead, this field serializes as "location":"(\n \"-73.9599\",\n \"40.72087\"\n)"

Help please! Thanks!

wvteijlingen commented 7 years ago

What Swift version are you using?

garySWARM commented 7 years ago

I just converted to Swift 3.0

wvteijlingen commented 7 years ago

Could you try if this works correctly when using an NSArray?

garySWARM commented 7 years ago

I just changed the type of location to: var location : NSArray? and the serializer gives the same result

wvteijlingen commented 7 years ago

This was because the value formatters defaulted to the string representation when no suitable formatter was found. I removed this, and this should work properly now. Please reopen this issue if there's still a problem.