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

Missing relationship data for included relationship #96

Open
beauby opened this issue Dec 12, 2016 · 3 comments
Open

Missing relationship data for included relationship #96

beauby opened this issue Dec 12, 2016 · 3 comments

Comments

@beauby
Copy link

beauby commented Dec 12, 2016

Other bug: when serializing a Post, and including comments, comments.post, comments.post.author, the author relationship of the primary post does not get populated, though comments.post refers to the primary post.

More generally, I believe there is an undefined behavior when a related resource can be reached via multiple relationship paths.

@ababich
Copy link

ababich commented Feb 28, 2017

https://github.com/fotinakis/jsonapi-serializers/blob/master/lib/jsonapi-serializers/serializer.rb#L115
https://github.com/fotinakis/jsonapi-serializers/blob/master/lib/jsonapi-serializers/serializer.rb#L150

I see an issue in these lines:
lets take an example above /get/posts?include=comment.author

in lines above default inslude_data is false and @_include_linkages never has comment match

this means that you will have list of posts and included list of comments but without data block and you cannot match them on client

@ababich
Copy link

ababich commented Feb 28, 2017

My immediate impression is that include_data should be defaulted to true, why not?

@beauby
Copy link
Author

beauby commented Mar 2, 2017

@ababich I believe your are referring to a different issue (namely that of full-linkage being incidentally broken by relationships' include data being omitted).

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