Gson ignoring map entries with value=null

Viewed 83314
Gson gson = new Gson();

Map<String,Object> map = new HashMap<String, Object>();
map.put("a", 1);
map.put("b", null);

System.out.println(gson.toJson(map)); //prints {"a":1}

How do I get it to include all entries?

1 Answers
Related