Dealing with Java and JSON conversion

When you are trying to convert any java object to json, you may run in to this problem. com.fasterxml.jackson.core.JsonGenerationException: Null key for a Map not allowed in JSON (use a converting NullKeySerializer?) This is due to null key in the map of objects (or collection of objects). JsonGenerator cannot serialize the null key into json. Ignore ’null’ values in the map So we can ignore ’null’ key and values from the ObjectMapper by using: ...

September 23, 2016