title: How can I create a model for this API (Kotlin-Retrofit)?
body: <p>I'm using <a href="https://www.api-football.com" rel="nofollow noreferrer">https://www.api-football.com</a> to get football countries and leagues, Json response for countries is like this:</p>
  <pre><code>{
  &quot;get&quot;: &quot;countries&quot;,
  &quot;parameters&quot;: [],
  &quot;errors&quot;: [],
  &quot;results&quot;: 164,
  &quot;paging&quot;: {
      &quot;current&quot;: 1,
      &quot;total&quot;: 1
  },
  &quot;response&quot;: [
      {
          &quot;name&quot;: &quot;Albania&quot;,
          &quot;code&quot;: &quot;AL&quot;,
          &quot;flag&quot;: &quot;https://media.api-sports.io/flags/al.svg&quot;
      },
      {
          &quot;name&quot;: &quot;Algeria&quot;,
          &quot;code&quot;: &quot;DZ&quot;,
          &quot;flag&quot;: &quot;https://media.api-sports.io/flags/dz.svg&quot;
      },
      {
          &quot;name&quot;: &quot;Andorra&quot;,
          &quot;code&quot;: &quot;AD&quot;,
          &quot;flag&quot;: &quot;https://media.api-sports.io/flags/ad.svg&quot;
      },
      
  
      ...
  </code></pre>
  <p>I tried to create a model like this:</p>
  <p>Here is the <code>CountryData</code> data class:</p>
  <pre><code>data class CountryData (
  val code: String,
  val flag: String,
  val name: String
  )
  </code></pre>
  <p>And here is the <code>Country</code> data class which uses CountryData and use them in a list:</p>
  <pre><code>data class Country(
  val results : List&lt;CountryData&gt;
  )
  </code></pre>
  <p>But those models give me some errors: <code>com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was NUMBER at line 1 column 61 path $.results</code></p>
  <p>And I think that's because of the api response type is not a list of <code>CountryData</code>.</p>
  <p>So if that's the problem, <strong>I want to get only the part after</strong> <code>&quot;response&quot;: [ ...</code> But I don't know how to do this.</p>
  <p>If you think another problem causes this error please let me know.</p>
  <p>By the way, here is the api interface:</p>
  <pre><code>interface FootballApi {
  
  @Headers(&quot;X-RapidAPI-Key: $API_KEY&quot;)
  @GET(GET_COUNTRIES)
  suspend fun getCountries() : Response&lt;Country&gt;
  }
  </code></pre>
  <p>And here is my Retrofit Instance :</p>
  <pre><code>object RetrofitInstance {
  
  val api: FootballApi by lazy {
      Retrofit.Builder()
          .baseUrl(BASE_URL)
          .addConverterFactory(GsonConverterFactory.create())
          .build()
          .create(FootballApi::class.java)
  }
  }
  </code></pre>