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

Do not build relationships section for not loaded relationships #103

Merged
merged 3 commits into from
Apr 16, 2018

Conversation

mvrkljan
Copy link
Contributor

@mvrkljan mvrkljan commented Apr 15, 2018

Currently if a resource has defined relationships on its view it is always generated an record in the relationships section. If the relationship is not loaded, it generates a relationship record with "id": null and record type.

This is not precisely per spec and can cause weird issues with front-end libraries when a record appears in relationships section with an id value of null.

Also, in case of one-to-many relationships, having a single record with id null can be misleading.

This PR updates the logic to not include an empty record if the relationship is not loaded.

@jeregrine
Copy link

Thanks! 💟

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

Successfully merging this pull request may close these issues.

2 participants