Here is a json snippet which contains an array(icons) which can contain two different types of objects(application and folder)
{
"icons": [
{
"application": {
"displayName": "Facebook",
"bundleId": "com.facebook.com"
}
},
{
"folder": {
"some": "value",
"num": 3
}
}
]
}
How can I create java POJO's modelling this kind of json and then deserialize the same?
I referred to this question. But I can't change the json I'm getting to include a 'type' as advised there and then use inheritance for the POJO's of the two different objects.