How can i parse this using retrofit? i'm getting the error BEGIN_OBJECT but was BEGIN_ARRAY
Right now, i'm parsing it this way..
Below is the adapter class
public static RetroInterface getCommonPathInterface() {
RestAdapter restAdapter = new RestAdapter.Builder()
.setEndpoint("myurl")
.build();
records= restAdapter.create(RetroInterface.class);
return records;
}
Below is the interface, RetroInterface.class
@GET("/mypath")
void getValue(
Callback<MyBean> callback
);
This is how i call it in the main activity
getCommonPathInterface().getValue(new Callback<MyBean>() {
@Override
public void success(MyBean myBean, Response response) {
inti = 0;
}
@Override
public void failure(RetrofitError error) {
int i = 0;
}
});
Below is the json response
[
{
id: "111",
name: "Val1"
},
{
id: "222",
name: "Val2"
}
]