title: Parse JSON array response using Retrofit & Gson
body: <p>Here is my JSONArray Response from Web service:</p>
  <pre><code>[
    {
      &quot;sponsors&quot;: [
        {
          &quot;leg_id&quot;: &quot;NYL000067&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;AUBRY&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000171&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;PERRY&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000066&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;ARROYO&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000223&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;BARRETT&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000312&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;STECK&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000180&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;RIVERA&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000114&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;GOTTFRIED&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000091&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;COOK&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000126&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;JAFFEE&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000327&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;DAVILA&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000144&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;LUPARDO&quot;
        },
        {
          &quot;leg_id&quot;: null,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;SEPULVEDA&quot;,
          &quot;committee_id&quot;: null
        },
        {
          &quot;leg_id&quot;: &quot;NYL000290&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;MOSLEY&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000167&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;ORTIZ&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000170&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;PEOPLES-STOKES&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000221&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;SKARTADOS&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000216&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;QUART&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000208&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;WEPRIN&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000186&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;ROSENTHAL&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000139&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;LIFTON&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000064&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;ABINANTI&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000173&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;PRETLOW&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000339&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;BICHOTTE&quot;
        },
        {
          &quot;leg_id&quot;: null,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;BARRON&quot;,
          &quot;committee_id&quot;: null
        },
        {
          &quot;leg_id&quot;: &quot;NYL000341&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;WALKER&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000355&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;BLAKE&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000185&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;RODRIGUEZ&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000259&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;FAHY&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000203&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;TITONE&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000286&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;MCDONALD&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000081&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;CAHILL&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000421&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;HARRIS&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000338&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;JOYNER&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000448&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;JENNE&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000070&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;BENEDETTO&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000310&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;SOLAGES&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000357&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;RICHARDSON&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000324&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;PICHARDO&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000423&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;HYNDMAN&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000313&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;STIRPE&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000131&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;KAVANAGH&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000204&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;TITUS&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000275&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;KIM&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000195&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;SIMOTAS&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000293&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;OTIS&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000220&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;MAYER&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000344&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;JEAN-PIERRE&quot;
        }
      ],
      &quot;id&quot;: &quot;NYB00099404&quot;
    },
    {
      &quot;sponsors&quot;: [
        {
          &quot;leg_id&quot;: &quot;NJL000113&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Vainieri Huttle, Valerie&quot;
        }
      ],
      &quot;id&quot;: &quot;NJB00038817&quot;
    },
    {
      &quot;sponsors&quot;: [
        {
          &quot;leg_id&quot;: &quot;NYL000208&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;WEPRIN&quot;
        }
      ],
      &quot;id&quot;: &quot;NYB00066288&quot;
    },
    {
      &quot;sponsors&quot;: [
        {
          &quot;leg_id&quot;: &quot;NJL000083&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Jasey, Mila M.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000086&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Caputo, Ralph R.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000046&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Watson Coleman, Bonnie&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000177&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Pintor Marin, Eliana&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000164&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Sumter, Shavonda E.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000104&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Oliver, Sheila Y.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000095&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Mainor, Charles&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000165&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Wimberly, Benjie E.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000016&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Fuentes, Angel&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000085&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Tucker, Cleopatra G.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000067&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Stender, Linda&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000114&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Johnson, Gordon M.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000082&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;McKeon, John F.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000129&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Singleton, Troy&quot;
        }
      ],
      &quot;id&quot;: &quot;NJB00030216&quot;
    },
    {
      &quot;sponsors&quot;: [
        {
          &quot;leg_id&quot;: &quot;NYL000088&quot;,
          &quot;official_type&quot;: &quot;SPONSOR&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Clark&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NYL000171&quot;,
          &quot;official_type&quot;: &quot;COSPNSR&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Perry&quot;
        }
      ],
      &quot;id&quot;: &quot;NYB00035573&quot;
    },
    {
      &quot;sponsors&quot;: [
        {
          &quot;leg_id&quot;: &quot;NJL000111&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Schaer, Gary S.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000018&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Lampitt, Pamela R.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000105&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Giblin, Thomas P.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000171&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Mosquera, Gabriela M.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000011&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Moriarty, Paul D.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000165&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Wimberly, Benjie E.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000010&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Madden, Fred H.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000007&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Sweeney, Stephen M.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000039&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Thompson, Samuel D.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000112&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Weinberg, Loretta&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000087&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Ruiz, M. Teresa&quot;
        }
      ],
      &quot;id&quot;: &quot;NJB00021785&quot;
    },
    {
      &quot;sponsors&quot;: [
        {
          &quot;leg_id&quot;: &quot;NYL000138&quot;,
          &quot;official_type&quot;: &quot;SPONSOR&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Lentol&quot;
        }
      ],
      &quot;id&quot;: &quot;NYB00010409&quot;
    },
    {
      &quot;sponsors&quot;: [
        {
          &quot;leg_id&quot;: &quot;NJL000028&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Gove, DiAnne C.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000027&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Rumpf, Brian E.&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000099&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Prieto, Vincent&quot;
        }
      ],
      &quot;id&quot;: &quot;NJB00002928&quot;
    },
    {
      &quot;sponsors&quot;: [
        {
          &quot;leg_id&quot;: &quot;NJL000094&quot;,
          &quot;type&quot;: &quot;primary&quot;,
          &quot;name&quot;: &quot;Chiappone, Anthony&quot;
        },
        {
          &quot;leg_id&quot;: &quot;NJL000034&quot;,
          &quot;type&quot;: &quot;cosponsor&quot;,
          &quot;name&quot;: &quot;Angelini, Mary Pat&quot;
        }
      ],
      &quot;id&quot;: &quot;NJB00010952&quot;
    }
  ]
  </code></pre>
  <p>Here is ApiInterface.java</p>
  <pre><code>public interface ApiInterface {
  
      @GET(&quot;bills/&quot;)
      Call&lt;SponsorsResult&gt; getListOfSponsors(@Query(&quot;bill_id&quot;) String billId , @Query(&quot;session&quot;) String session, @Query(&quot;fields&quot;) String field);
  
  }
  </code></pre>
  <p>And here is call of method &amp; response :</p>
  <pre><code>ApiInterface apiService = ApiClient.getClient().create(ApiInterface.class);
  
  Call&lt;SponsorsResult&gt; call = apiService.getListOfSponsors(AppConstants.ASSEMBLY_BILL_ID,AppConstants.SESSION,AppConstants.FIELD);
  call.enqueue(new Callback&lt;SponsorsResult&gt;() {
      @Override
      public void onResponse(Call&lt;SponsorsResult&gt; call, Response&lt;SponsorsResult&gt; response) {
  
          Log.d(TAG,&quot;Number :&quot; + response.raw());
          List&lt;Sponsor&gt; sponsors = response.body().getSponsors();
          Log.d(TAG,&quot;Number of sponsors :&quot; + sponsors.size());
      }
  
      @Override
      public void onFailure(Call&lt;SponsorsResult&gt; call, Throwable t) {
          t.printStackTrace();
      }
  });
  </code></pre>
  <p>As of now it fails &amp; here is logcat output :</p>
  <pre><code>com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
  </code></pre>
  <p>It fails to execute response . Guide me to parse this response.</p>