I have this JSON :
{
"attributes": {
"date": "2016-01-01"
},
"first": "05:33",
"second": "05:50",
"third": "07:22"
}
Usually we do something like this to parse this json using Gson retrofit parser :
Class MyObject {
@SerializedName("attributes")
Attribues attributes;
@SerializedName("first")
String first;
@SerializedName("second")
String second;
@SerializedName("third")
String third;
}
And
Class Attributes {
@SerializedName("date")
String date;
}
But what I want to do is this:
Class MyObject {
// I want date to be here and ignoring the attributes key <---
String date;
@SerializedName("first")
String first;
@SerializedName("second")
String second;
@SerializedName("third")
String third;
}
How can we do this ?