Json I get from Server is :
{
"data" : [
{ "id":1, "url": "http://example.com/image1" },
{ "id":2, "url": "http://example.com/image2" },
{ "id":3, "url": "http://example.com/image3" }
]
}
and the class I have for mapping is
public class Repository {
private List<Event> events;
}
although I get a success from retrofit I can't map it to my object.
Also I have class Event
with int id and String url.
change it like this
public class Repository {
private List<Event> data;
}
or
public class Repository {
@SerializedName("data")
private List<Event> events;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With