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

Properly handle relations without data #78

Merged
merged 4 commits into from
Aug 5, 2020
Merged

Properly handle relations without data #78

merged 4 commits into from
Aug 5, 2020

Conversation

JaZo
Copy link
Member

@JaZo JaZo commented Aug 5, 2020

Description

If a relation does not have data (i.e. only links or meta), it should not be serialized as if it is empty (i.e. null or an empty array). This PR addresses that issue and also adds links and meta to the serialized array as those were missing.

Motivation and context

Fixes #77.

How has this been tested?

Tested with JSON provided in #77.

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

  • I have read the CONTRIBUTING document.
  • My pull request addresses exactly one patch/feature.
  • I have created a branch for this patch/feature.
  • Each individual commit in the pull request is meaningful.
  • I have added tests to cover my changes.
  • If my change requires a change to the documentation, I have updated it accordingly.

JaZo added 3 commits August 5, 2020 10:59
If the relation does not have data (i.e. only meta or links), we should not init the relation as if the data is empty (i.e. null or an empty array).
If the relation does not have any data, we should not serialize it as having empty data (i.e. null or empty array).
@JaZo JaZo force-pushed the bugfix/issue-77 branch from c5a85fa to c9e6813 Compare August 5, 2020 08:59
@JaZo JaZo merged commit 7ff218f into master Aug 5, 2020
@JaZo JaZo deleted the bugfix/issue-77 branch August 5, 2020 10:52
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.

Links-only relations not handled correctly
1 participant