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

Serializer should not fail when top level "data" attribute is present but nil #77

Closed richardmcclellan closed 8 years ago

richardmcclellan commented 8 years ago

I am currently using a API that returns the following response:

{
    "data": null
}

According to the JSONAPI spec, this is a valid format, but Spine returns the following serializer error: Either 'data', 'errors', or 'meta' must be present in the top level.

wvteijlingen commented 8 years ago

I merged your PR that fixes this. Thanks for contributing!