Parse a nested json with retrofit 2.0
<p>i have this json's and i want to use retrofit for parsing them. </p>

<pre><code>{
  "status": "true",
  "data": [
{
  "id": "1",
  "title": "Hi :)",
  "text": "&lt;p&gt;121212&lt;/p&gt;",
  "cat_id": "1",
  "username": "admin",
  "coin": "0",
  "datetime": "1451508880",
  "isShow": "1"
},
{
  "id": "3",
  "title": " Hi :)",
  "text": "Hi :)",
  "cat_id": "2",
  "username": "Hi :)",
  "coin": "20",
  "datetime": "1451508880",
  "isShow": "1"
},
{
  "id": "4",
  "title": "a",
  "text": "someText",
  "cat_id": "1",
  "username": "admin",
  "coin": "10",
  "datetime": "1451982292",
  "isShow": "1"
}
  ]
}
</code></pre>

<p>when that json is in array mode my code work. but my question is how parse  nested json like above sample?</p>

<p>here my javaClass: (statusClass)</p>

<pre><code>public class retroStatus {

@SerializedName("status")
private String status;

@SerializedName("data")
private ArrayList&lt;retroPost&gt; data;

  //getters And Setters
}
</code></pre>

<p>(retroPost Class)</p>

<pre><code>public class retroPost {

@SerializedName("id")
private int id;

@SerializedName("title")
private String title;

@SerializedName("text")
private String text;

@SerializedName("cat_id")
private int cat_id;

@SerializedName("datetime")
private long datetime;


 //getters And Setters
}
</code></pre>

<p>(getPostInterface)</p>

<pre><code>public interface getPost {
@GET("get/posts/all")
Call&lt;List&lt;retroStatus&gt;&gt; getPost();
}
</code></pre>

<p>(and mainCode)</p>

<pre><code>  Retrofit retrofit = new Retrofit.Builder()
            .baseUrl("http://mywebsite.it/api/")
            .addConverterFactory(GsonConverterFactory.create())
            .build();
    getPost postService = retrofit.create(getPost.class);
    Call&lt;List&lt;retroStatus&gt;&gt; call = postService.getPost();
    Callback&lt;List&lt;retroStatus&gt;&gt; callback = new Callback&lt;List&lt;retroStatus&gt;&gt;() {
        @Override
        public void onResponse(Response&lt;List&lt;retroStatus&gt;&gt; response, Retrofit retrofit) {
            if (response.isSuccess()) {
                for (retroStatus status : response.body()) {
                    Log.e("test", "nowStatusIs: " + status.getStatus());
                }
            } else {
                Log.e("test", "Failed");
            }


        }

        @Override
        public void onFailure(Throwable t) {
            Log.e("test", "onFailure");
        }
    };
    call.enqueue(callback);
</code></pre>

<p>now when run the app, onFailure happend but if main json just in onejsonArray and use just retroPost for parsing that thats work's very nice... what i mistake ?<br>
sorry for bad english... </p>