title: How can Retrofit 2.0 parse nested JSON object?
body: <p>Our team decide to use <a href="http://square.github.io/retrofit/" rel="noreferrer">Retrofit 2.0</a> and I'm doing some initial research on this library. As stated in the title, I want parse some nested JSON objects via Retrofit 2.0 in our Android app. </p>
  
  <p>For example, <a href="https://api.flickr.com/services/feeds/photos_public.gne/services/feeds/photos_public.gne?tagmode=all&amp;format=json&amp;nojsoncallback=1&amp;tags=android" rel="noreferrer">here</a> is a nested JSON object with the format:</p>
  
  <pre><code>{
          "title": "Recent Uploads tagged android",
          "link": "https://www.flickr.com/photos/tags/android/",
          "description": "",
          "modified": "2015-10-05T05:30:01Z",
          "generator": "https://www.flickr.com/",
          "items": [
          {
              "title": ...
              "link": ...
              "media": {"m":"This is the value I want to get:)"}
              "description": ...
              "published": ...
              "author": ...
              "author_id": ...
              "tags": ...
          },
          {...},
          ...
          ]
  }
  </code></pre>
  
  <p>I'm interested in the JSON objects inside <code>items</code> array. I notice there are <a href="https://stackoverflow.com/questions/23070298/get-nested-json-object-with-gson-using-retrofit">some posts</a> about parsing nested JSON objects via Retrofit 1.X, but the latest Retrofit 2.0 APIs has changed a lot, which is confusing when adapting them to the new APIs.</p>
  
  <p>Two possible solutions come into my mind:</p>
  
  <ol>
  <li>Write my own JSON converter factory which extends <a href="https://square.github.io/retrofit/javadoc/retrofit/Converter.Factory.html" rel="noreferrer">Converter.Factory</a>.</li>
  <li>Return the raw response in a String type and parse it by myself. But it's not easy to get the raw response from Retrofit 2.0 according to my initial research. Retrofit 2.0 seems to insist in converting the response to something before pass it to me and Retrofit doesn't provide its own <code>StringConverter</code>. (I might be wrong~)</li>
  </ol>
  
  <p><strong>Update:</strong> We can actually get the raw response by setting <code>JSONElement</code> as the pojo for the HTTP API interface and use GSONConverter provided by Retrofit as the converter.</p>