Skip to content Skip to sidebar Skip to footer

Retrofit 2 Response Body Is Empty Or Model Class Is Wrong. Cannot Get JSON Data It Gives An Exception: Expected BEGIN_ARRAY But Was BEGIN_OBJECT

This is my JSON response: { status: 'ok', count: 25, categories: [ { id: 60, slug: '3d', title: '3D', description: '', parent: 70, post_count: 86 }, { id: 2, slug: 'action-adventur

Solution 1:

your model is wrong it should look like this pseudo code

public Response{
    String status;
    int count;
    List<Category> categories;

Post a Comment for "Retrofit 2 Response Body Is Empty Or Model Class Is Wrong. Cannot Get JSON Data It Gives An Exception: Expected BEGIN_ARRAY But Was BEGIN_OBJECT"