I have a json like below :
{"key":{"a":"aValue"}}
"key" can contain json object as well as json array. i have created following java object to map this json :
Class Output {
private List<DummyObject> key;
// setter, getting ommited
}
Class DummyObject {
private String a;
}
So, i want if json is
{"key":[{"a":"val1"},{"a":"val2"}]}
"key" property of Output class should contain a list of 2 objects, and when the json is
{"key":{"a":"val1"}}
"key" should contain a list of 1 object only.
I have tried using deserializer but it does not work. Also, i do not want to deserialise DummyObject
myself.