Closed cgendreau closed 1 year ago
Thx, since the proposed solution of #51 could be applied, I close this issue. Please re-open when you require changes in the library.
Thanks for your response. We tried couple of different options and preserving the keys of the JSON:API document seems to be the easiest way to accommodate that.
If possible, it would be interesting to see what was available here (from #51) (it's not available anymore):
I have created a little demo with your example (including serialization and patch method), you can download it at https://my.hidrive.com/share/ylcmjtbywn
We are trying to achieve something very similar to #51 where we need to change back a value to
null
(could be a relationship or an attribute). If we take the Movie example, one could imagine setting theimdbId
toABC
and then trying to setting it tonull
. So a mechanism would be required to differentiate a value that is set tonull
vs an attribute that was not provided in the PATCH that isnull
due to its initial value.The
OptionalProperty
suggested in #51 is one way to achieve that. Another way may be to preserve the keys from the Map<String, Object> that is sent to Jackson inAbstractJsonApiModelDeserializer
. Something like an augmentedEntityModel
could offer a way to check if an attribute/relationship was explicitly provided. Far from perfect, I'm more wondering about potential solution.Thanks for the library!