I have a problem with one type of JSON.
Example:
{
"1": "name",
"2": "example",
"3": "loremipsum",
"4": "etc",
}
I'm always converting json to POJO with Gson. I'm using Retrofit 1.9
But in this case its stupid because I receive object like:
public class Example {
@SerializedName("1")
@Expose
private String _1;
@SerializedName("2")
@Expose
private String _2;
@SerializedName("3")
@Expose
private String _3;
@SerializedName("4")
@Expose
private String _4;
.........
How can I parse this JSON to receive list of objects like:
public class Example {
private int id;
private String value;
}
Thanks for help.