I'm using Gson to parse json to my object :
@SerializedName("MyAttribute")
private List<MyObject> myObject;
But in one call the answer for the same attribute could be different. In one hand :
"MyAttribute":[
"stringInformation",
"stringInformation2"
]
It's a list of String, In the other hand it's a list of object :
"MyAttribute":[
{
"id":"info",
"info":"info",
"info2":"info
},
{
"id":"info",
"info":"info",
"info2":"info
}
]
For mapping the object it's ok, my Gson is set to parse this into the list of my object. But I would like to create a list of these object if it's only a list of Strgin in my json file. Do you have an idea how to deal with it ? Thank you