I want to deserialise a String to JsonNode while converting all doubles to ints where possible. For example, with the following code
// str is = { "a": 1.0, "b": 0.5 }
var objectMapper = new ObjectMapper();
JsonNode n = objectMapper.readTree(str);
Current behavior: Both children of n are type DoubleNode.
Goal: For the children of n, a is type IntNode and b is type DoubleNode.
I've seen a lot of custom deserializers on here but they only apply to defined POJOs and not arbitrary JsonNode deserialization. Would appreciate any help on how to customize the string to JsonNode deserialization.