Closed yogipatel closed 5 years ago
I would add a test for this
A test would be great!
Any updates on this? Seems like a fantastic improvement and am currently being bit by the dreaded parse error JSON::API::InvalidDocument: a relationship object MUST contain at least one of 'links', 'data', or 'meta'
Sorry, got lost in the noise. I'll put up some tests. Looks like the codepath is different now so might take me a couple of days.
@yogipatel I'm trying to get some of the easier issues and PRs wrapped up before getting the next release out. If you can get a test added in the next week or so it will get added, otherwise we'll get it in after. Thanks!
@beerlington, any updates on this one?
By the way, if you make use of the following option,
include: "author,comments.author"
You don't get empty relationships
Closed in favor of https://github.com/vt-elixir/ja_serializer/pull/311
Addresses #232
Per the JSON-API spec,
is not a valid format for the
comments
relationship. This PR adds a filter to the relationship builder that removes any relationship entry that provides no information (no data, links, or meta). As a (useful) side-effect, if the relationships key is empty, it too is omitted.