-
Notifications
You must be signed in to change notification settings - Fork 20
Description
JSONObject, which is used to create the payload of the request, does not put fields in the payload if they have the value (java) null. If we want to add a field with the value null, it has to have the value "JSONObject.NULL" (see the json object documentation)
There are two ways we can handle this:
-
Create a NullFieldModel class which gets a name and always returns the value JSONObject.NULL. When the user wants to set a field with a null value, it will create a new instance of this class and set it in the entity model.
-
Treat all null values as JSONObject.NULL. This might have a backwards compatibility impact since now some fields which were previously ignored, will be added to the request and will have the value null.
I personally think that the first option is better.