I am using the jackson-databind 2.9.10. I tried to upgrade the version.
I tried many versions. But, trying with the latest now which is 2.12.2
With all the versions greater than 2.9.10, I am getting compilation issue on the below code.
Map<String, List<Map<String, Object>>> result =
objectMapper.readValue(inputResponse, new TypeReference<Map<String, Object>>() {
});
Issue: incompatible types: inference variable T has incompatible bounds
Input response is on the string format of below json:
{
"config": [{
"key1": "value1",
"key2": "value2",
"key3": [{
"key3.1": "value3.1",
"key3.2": "value3.2",
"key3.3": [{
"key3.3.1": "value3.3.1",
"key3.3.2": "value3.3.2"
}]
}]
}]}
From jackson mapper 2.10.0 onwards, bounds of the TypeReference have to match the type of the response variable.
For more info: https://github.com/FasterXML/jackson-databind/pull/2196