title: How to parse complex JSON with Retrofit 2 in Android Studio
body: <p>I am trying to get the stopId from this API but I am having a hard time parsing it using retrofit 2 + gson. I've only got experience with less complicated JSON API's. Could anyone help me?                                                                                                             </p>
  
  <pre><code>{
      "direction": "inbound",
      "timetable": {
          "$type": "Tfl.Api.Presentation.Entities.Timetable, Tfl.Api.Presentation.Entities",
          "departureStopId": "940GZZCRECR",
          "routes": [{
              "$type": "Tfl.Api.Presentation.Entities.TimetableRoute, Tfl.Api.Presentation.Entities",
              "stationIntervals": [{
                  "$type": "Tfl.Api.Presentation.Entities.StationInterval, Tfl.Api.Presentation.Entities",
                  "id": "0",
                  "intervals": [{
                      "$type": "Tfl.Api.Presentation.Entities.Interval, Tfl.Api.Presentation.Entities",
                      "stopId": "940GZZCRLEB",
                      "timeToArrival": 2
                  }, {
                      "$type": "Tfl.Api.Presentation.Entities.Interval, Tfl.Api.Presentation.Entities",
                      "stopId": "940GZZCRSAN",
                      "timeToArrival": 3
                  }]
              }, {
  
              }, {
  
              }],
              "schedules": [
  
              ]
          }]
      }
  }
  </code></pre>