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

[JSON-API] Rendering an empty relationship #189

Closed
lasseebert opened this issue Apr 15, 2016 · 1 comment
Closed

[JSON-API] Rendering an empty relationship #189

lasseebert opened this issue Apr 15, 2016 · 1 comment

Comments

@lasseebert
Copy link

I would like to render empty (nil) relationships with JSONAPI like so:

{
  "relationships": {
    "some_relation": { "data": null }
  }
}

This is what the jsonapi specification says. See http://jsonapi.org/format/#document-resource-object-linkage

When I use render_nil: true in a has_one I get

undefined method `each' for nil:NilClass

It seems like a simple issue to fix inside the JSON::JSONAPI. Can anyone confirm that it's not just me doing something stupid? If so I'll be happy to fix it in a pull request :)

@myabc
Copy link
Contributor

myabc commented Dec 10, 2016

This issue was moved to trailblazer/roar-jsonapi#8

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

No branches or pull requests

2 participants