The update function of InventoryApi returns a ManagedObjectRepresentation object of the result.
In my code, I successfully use update() and later, try to update the returned ManagedObjectRepresentation (e.g. set some fragments), calling InventoryApi.update() again.
Calling this, I get an error code 422 with message:
Following fields are not updateable: lastUpdated
This is because the previously returned object has that field set, the REST API does not expect that field to have a value.
Now comes my question: looking inside the com.cumulocity.rest.representation.inventory.ManagedObjectRepresentation class, I see the lastUpdated field (line 36) has a @Null annotation for certain "operations".
My loose interpretation of this is that somewhere in the SDK, if this object is used as part of a CREATE or UPDATE operation, that field should be null. If this were the case, my above update() call with a ManagedObjectRepresentation that has this field set, should not cause problems. This is not the case.
What is the actual use of this @Null annotation? Am I using the SDK wrongly? I know that one way to make the request work is simply to set the lastUpdated field to null, but I thought that was the purpose of the @Null-annotation..
Using the Java client library version 8.13.