Let's assume I have the following json
[
{
"00080005":{
"vr":"CS",
"Value":[
"ISO_IR 100"
]
},
"00080054":{
"vr":"AE",
"Value":[
"DCM4CHEE"
]
}
}
]
How to create a custom class to map this in java? I tried this class shape
public class custom1 {
private Map<String, cusomt2> id;
}
and cusomt2
shape is
public class cusomt2 {
private Object vr;
private Object[] Value;
}
and used Jackson mapper to map
ObjectMapper mapper = new ObjectMapper();
List<custom1> test = Arrays.asList(mapper.readValue(responseStream, custom1[].class));
It's as expected, gives me an error :
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "00080005"
I want "0008005" as the field value not the field key, these values are dynamically changes according to the API, so how to map this json, is there any direct way other the last option op custom deserialize?