Closed ghost closed 4 years ago
Hello @michael-flagg-vtas, thanks for the PR.
Please rebase your brach from current develop to resolve conflicts.
Thanks @jasminb - I've rebased my branch.
Hello! If you have questions about this PR or requests to change it over the next week, please contact me.
Hi Team,
Actually this PR is what we were looking for. Some related resources are not necessary.
For the reason of reducing data size, we might only set an links
object but without data
in relationship objects,
But in this PR, I think we might also need to consider to remove the resource objects from the the included resource objects
.
In our side, we simply adjust this part codes a bit, and allow null
value relationship fields to generate relationship objects if links or meta presenting.
Thus we can control it during run-time.
Move `if (relationshipObject != null) {` at line 844 to where we were going to set the data.
Peace and Long Life, Boris
I checked in the changes at #227 ;)
Merged, ty @michael-flagg-vtas!
Thanks @jasminb - much appreciated!
These changes are intended to fix issue #186 (
@RelationshipLinks
without@Relationship
not working). The JSON:API spec does not require that relationship objects containdata
. Until now, it was not possible avoid serialization of relationshipdata
even if it will never be populated.Implementation: I've extended the
@Relationship
annotation with a newserialiseData
field. Existing behavior is retained by default, making this a non-breaking change. SettingserialiseData
tofalse
will disable serialization of thedata
section. It will also prevent generation ofincluded
resources for the annotated relationship.