Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't explode when parsing {"data": null} #191

Merged
merged 1 commit into from
Jul 4, 2016

Conversation

reidab
Copy link
Contributor

@reidab reidab commented Jun 14, 2016

Per http://jsonapi.org/format/#fetching-resources, it is sometimes appropriate for an API to respond with a 200 status and null data when the requested URL is one that might correspond to a single resource, but doesn’t currently.

Previous to this change, attempting to parse such a response would throw NoMethodError: undefined method 'slice' for nil:NilClass as it tried to extract params from nil

Per http://jsonapi.org/format/#fetching-resources, it is sometimes
appropriate for an API to respond with a 200 status and null data
when the requested URL is one that might correspond to a single
resource, but doesn’t currently.
@chingor13
Copy link
Collaborator

Thanks

@chingor13 chingor13 merged commit bfeb0a7 into JsonApiClient:master Jul 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants