jasminb / jsonapi-converter

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

Support to write links or meta fields but no data filed in relationship objects. #227

Closed BorisJineman closed 4 years ago

BorisJineman commented 4 years ago

Hi Team,

We were working on some projects using jsonapi-converter library to make sure our response is strictly following the standard.

We met a problem when we write relationship objects. For the reason of reducing the data size, we would like to only write links out, but without embedding Included resource objects in included field. The most similar issue is https://github.com/jasminb/jsonapi-converter/issues/186

To implement above requirement and resolve the problem. We did a simply change. It can allow users to only write links or meta fields but no data filed in relationship objects.

Usage: Simply set the Relationship field to null at runtime.

Given the Relationship field are equals to null, so it will also not appears in Included resource objects.

Could team review it, thanks a lot.

Peace and Long Life, Boris

BorisJineman commented 4 years ago

Hide whitespace changes might be helpful,

https://github.com/jasminb/jsonapi-converter/pull/227/files?utf8=%E2%9C%93&diff=split&w=1

jasminb commented 4 years ago

Hello @BorisJineman, thanks for the PR.

Will take a look and merge/leave comments as soon as I can.

Cheers

BorisJineman commented 4 years ago

Hi @jasminb and Team,

Thank you very much, :)

BorisJineman commented 4 years ago

Hi team, I saw that #224 have been merged, and it was going to deal a same problem, so I closed it.