Gson ignoring map entries with value=null

See Gson User Guide – Null Object Support:

The default behaviour that is implemented in Gson is that null object fields are ignored. This allows for a more compact output format; however, the client must define a default value for these fields as the JSON format is converted back into its Java form.

Here’s how you would configure a Gson instance to output null:

Gson gson = new GsonBuilder().serializeNulls().create();

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)