Skip to content

HasManyThrough not working #425

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

Closed
wisepotato opened this issue Oct 11, 2018 · 2 comments
Closed

HasManyThrough not working #425

wisepotato opened this issue Oct 11, 2018 · 2 comments

Comments

@wisepotato
Copy link
Contributor

wisepotato commented Oct 11, 2018

Description

When using the HasManyThrough the includes parameter is not included (killing my angular orm), I've been searching through the source code and it only happens only the HasManyThrough.

Environment

  • JsonApiDotNetCore Version: master-latest
  • Other Relevant Package Versions:
@wisepotato wisepotato changed the title [FromBody] not working on PatchAsync Includes not working with many-to-many Oct 11, 2018
@wisepotato
Copy link
Contributor Author

Alright, more information. I debugged the hell out of JsonApiDotNetCoreExampleTests.Acceptance.Can_Fetch_Many_To_Many_Through and it seems that the body that is being generated does not include an includes key. This is also signified by the fact that the tag is not properly fetched.

This seems to support my theory, and gave me a headache :)

Atleast I now know your pipeline a bit better. Cool beans.

@wisepotato wisepotato changed the title Includes not working with many-to-many 'Includes' not working with many-to-many Oct 12, 2018
@wisepotato wisepotato changed the title 'Includes' not working with many-to-many includes key not being set on HasManyThrough Oct 12, 2018
@wisepotato wisepotato changed the title includes key not being set on HasManyThrough includes key not being set on HasManyThrough Oct 12, 2018
@wisepotato wisepotato changed the title includes key not being set on HasManyThrough HasManyThrough not working Oct 12, 2018
@maurei
Copy link
Member

maurei commented Oct 12, 2018

#426 contains two tests that are different from before:
Can_Fetch_Many_To_Many_Through => /api/v1/articles?include=tags
and
Can_Fetch_Many_To_Many_Through_Nested => /api/v1/articles/{article.Id}?include=tags

In both cases, the actual response body does not include a "include" section in the DocumentData.

The deserializer does convert the response body to a Article object with a Tag relation, but this Tag instance is only partially filled (as deduced from the ArticleTag jointable, i.e. just the id is filled, and name is null)

jaredcnance added a commit that referenced this issue Oct 14, 2018
fix(#425): fetching HasManyThrough returns no includes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants