You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: