title: How to Parse Nested / Multiple Json Objects using Retrofit
body: <p>The JSON I'm parsing looks like this:</p>
  
  <pre><code>{   "version": 1
      "data": {
          "1001": {
            "id": 1001,
            "name": "herp",
            "into": [
              "3111": "we"
            ]
          }, 
          "1032": {
            "id": 1002,
            "name": "derp",
            "into": [
              "36": "w",
              "12341: "c"
            ],
            "tags": [
              "hi there"
            ],
            "cost" {
              "even": 15
            }
          }, 
          "1603": {
            "id": 1003,
            "name": "her",
            "into": [
              "37": "dll",
              "58": "eow",
              "32145": "3a"
            ],
            "cost" {
              "highest": 325
              "lowest": 100
            }
          }, 
          .... Even more data
  }
  </code></pre>
  
  <p>The Json that is within "data" goes on for a while and does not have a set endpoint. I have no control over the Json, I'm just trying to read it. Unfortunately, with my class code I'm unable to get it to work. When I make a retrofit call the information inside "data" is empty.</p>
  
  <p>I've tried many iterations of implementing this, including using a deserializer and restructuring my POJO code. This is the current state of my Data class:</p>
  
  <pre><code>public class Data {
  
    private Map&lt;String, Item&gt; itemData;
  
    // Relevant Getters, Setters and Constructors //
  }
  </code></pre>
  
  <p>For my Item Class, the main issue is that the JSON Content isn't set, it can vary at times. As you can see above the values inside "into" vary and sometimes the amount of things within item changes as well such as "tags" or "cost":</p>
  
  <pre><code>public class Item {
  
    private int id;
    private String name;
    private String group;
    private String description;
    private Map&lt;String, String&gt; into;
    private List&lt;String&gt; tags;
    private Map&lt;String, Integer&gt; cost;
  
    // Relevant Getters, Setters and Constructors //
  </code></pre>
  
  <p>When I use this code my data class is empty, I don't see any errors in the log so I can't seem to figure out why the GSON isn't working with this.</p>
  
  <p>In case you wanted to see how I construct my RestClient, here it is:</p>
  
  <pre><code>RestAdapter.Builder builder = new RestAdapter.Builder()
          .setEndpoint(ROOT)
          .setClient(new OkClient(new OkHttpClient()))
          .setLogLevel(RestAdapter.LogLevel.FULL);
  
  RestAdapter restAdapter = builder.build();
  REST_CLIENT = restAdapter.create(DataApi.class);
  </code></pre>
  
  <p>I know that my Rest Query works because I can get the content within "version" but everything inside data is null.</p>