Skip to content

fix(#192): self links not serialized without a related link #225

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sarus
Copy link
Contributor

@sarus sarus commented Feb 14, 2020

This PR is to fix a regression introduced by 3d776ef and covered in issue #192

The original commit was meant to ignore relationshipLinks that return null but the commit did not take into account the fact that relationshipLinks can include a self and/or related link. As a result, if there was a self link but no related link the original commit would not display the relationshipLinks.

This PR fixes this by modifying the getLinks method to not return keys which evaluate to null (switch from map to reduce). Null relationship links will not be returned as intended by the original commit but if a non-null relationship link exists it will still be displayed (i.e., you can have self links again). The PR also adds additional test coverage to cover all permutations of self and related links being null.

Please consider merging this PR into master to fix a fairly large regression introduced in 3.6.1.

Thank you!

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.

1 participant