title: Converting Json to Pojo
body: <p>I've recently decided to rewrite one of my older android applications and I can't figure out how to convert server response like this: </p>
  
  <pre><code>{
      "response": "SUCCESS",
      "data": {
          "0": {
              ... fields ... 
          },
          "1": {
              ... fields ...
  
          },
          ... another objects
      }
  }
  </code></pre>
  
  <p>to regular java object (or in this case list of objects). I was previously using this method:</p>
  
  <pre><code>    JSONObject response = new JSONObject(stringResponse);
      JSONObject dataList = response.getJSONObject("data");
      int i = 0;
      while (true) {
          dataList.getJSONObject(String.valueOf(i)); // here I get wanted object
          i++;
      }
  </code></pre>
  
  <p>to get relevant objects and then I can put them into List, but now I'm using <strong>Retrofit</strong> library and I'm not able to find any clean solution to parse such weird object using gson and retrofit. </p>
  
  <p>Thanks for any help.</p>
  
  <p>Edit: What I want:</p>
  
  <p>Send request using retrofit like this:</p>
  
  <pre><code>@GET("/some params")
  void restCall(... another params..., Callback&lt;Response&gt; callback);
  </code></pre>
  
  <p>and then have List of objects in Response object. What I don't know is how to declare Response object, so it can convert that weird response into normal List of objects.</p>