jasminb / jsonapi-converter

JSONAPI-Converter is a Java/Android library that provides support for working with JSONAPI spec
Apache License 2.0
272 stars 81 forks source link

Allowing relationship links to get serialized for null relationship object #246

Open shipra-aeron opened 3 years ago

shipra-aeron commented 3 years ago

The purpose of this PR is to allow to have all the relationships of a resource object to be always present inside relationships node and have links if they exists for a relationship.

As per the json api spec ->

A “relationship object” MUST contain at least one of the following:

Since above we have allowed all the relationships node to be always present, hence one should also provide a way to have atleast one to be always present out of the (data, meta and links)

The sole need for the above change is to make the client be aware of all the relationships associated with the resource objects.

jasminb commented 3 years ago

@shipra-aeron will take a look and comment/merge.

Thanks for the PR.

Edit: Currently bit ill, will probably take few days to do the above.