I want to fetch json from a url https://api.myjson.com/bins/mxcsl/ using retrofit and rxjava. Sample json is this :
{
"data": [
{
  "itemId": "1",
  "desc": "Batcave",
  "audio": "https://storage.googleapis.com/a/17.mp3"
},
{
  "itemId": "2",
  "desc": "Fight Club rules",
  "audio": "https://storage.googleapis.com/a/2514.mp3"
},
{
  "itemId": "3",
  "desc": "Make an offer",
  "audio": "https://storage.googleapis.com/a/47.mp3"
}]}
And here is my code : Data Model :
public class Data {
private String itemId;
private String desc;
private String audio;
public String getItem() {
    return itemId;
}
public String getDesc() {
    return desc;
}
public String getAudio() {
    return audio;
}}
This is the Interface :
public interface RequestInterface {
@GET("/bins/mxcsl/")
Observable<List<Data>> register();
}
I'm loading something like this :
private void loadJSON() {
    RequestInterface requestInterface = new Retrofit.Builder()
            .baseUrl(BASE_URL)
            .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
            .addConverterFactory(GsonConverterFactory.create())
            .build().create(RequestInterface.class);
    mCompositeDisposable.add(requestInterface.register()
            .observeOn(AndroidSchedulers.mainThread())
            .subscribeOn(Schedulers.io())
            .subscribe(this::handleResponse,this::handleError));
}
private void handleResponse(List<Data> androidList) {
    mAndroidArrayList = new ArrayList<>(androidList);
    mAdapter = new DataAdapter(mAndroidArrayList);
    mRecyclerView.setAdapter(mAdapter);
}
private void handleError(Throwable error) {
    Toast.makeText(this, "Error "+error.getLocalizedMessage(), Toast.LENGTH_SHORT).show();
}
But Also I'm getting the error expected BEGIN_ARRAY but was BEGIN_OBJECT
I don't know where this is going wrong. Please help.
 
     
     
    