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

fix(kitsu-core): fix deserialisation of relationships from primary data #683

Merged
merged 1 commit into from
Jun 23, 2022

Conversation

pedep
Copy link
Contributor

@pedep pedep commented Jun 20, 2022

I ran into this issue where resource relationships would not deserialise correctly, due to being removed from includes.
According to the git history of AMS, this is inteded behaviour rails-api/active_model_serializers@f4bb4c8

It seems to be described by this line in the jsonapi spec:
A compound document MUST NOT include more than one resource object for each type and id pair.
(more on the topic https://discuss.jsonapi.org/t/why-is-included-an-array/76/4)

With this very minor change, this edge-case should be handled correctly.

@pedep pedep force-pushed the deserialize-relationships-from-data branch 2 times, most recently from 890c0c4 to a6e0c49 Compare June 23, 2022 13:15
@pedep pedep force-pushed the deserialize-relationships-from-data branch from a6e0c49 to c83a5ec Compare June 23, 2022 14:13
@pedep pedep force-pushed the deserialize-relationships-from-data branch from c83a5ec to 9a480b9 Compare June 23, 2022 14:17
@wopian wopian self-requested a review June 23, 2022 22:45
@wopian wopian self-assigned this Jun 23, 2022
@codeclimate
Copy link

codeclimate bot commented Jun 23, 2022

Code Climate has analyzed commit 9a480b9 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (100% is the threshold).

This pull request will bring the total coverage in the repository to 100.0% (0.0% change).

View more on Code Climate.

@wopian
Copy link
Owner

wopian commented Jun 23, 2022

Thank you for the fix! 🎉

@wopian wopian merged commit 42b871e into wopian:master Jun 23, 2022
@wopian
Copy link
Owner

wopian commented Jun 23, 2022

Published as 10.0.0-alpha.24

@pedep pedep deleted the deserialize-relationships-from-data branch June 24, 2022 09:12
pedep added a commit to pedep/ngx-kitsu that referenced this pull request Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants