I'm using Jackson 2.6.3 to deserialize JSON strings to Java objects and I have a piece of code below:
ObjectMapper objectMapper = new ObjectMapper();
HashMap<?, ?> result = objectMapper.readValue("null", HashMap.class);
// result is null
System.out.println(result == null);
I wonder if Jackson has any configurations to not convert String
"null"
to null
object but throw an exception?