title: JsonArray to Kotlin data class using Retrofit (Expected BEGIN_OBJECT but was BEGIN_ARRAY)
body: <p>I'm using Retrofit2</p>
  
  <pre><code>fun create(): MyApiService {
  
      return Retrofit.Builder()
                  .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                  .addConverterFactory(GsonConverterFactory.create())
                  .baseUrl(BASE_URL)
                  .build()
                  .create(MyApiService::class.java)
  }
  </code></pre>
  
  <p>to implicitly convert the following Json</p>
  
  <pre><code>[
      {
          "id": 1,
          "name": "John",
      }, {
          "id": 2,
          "name": "Mary",
      }
  ]
  </code></pre>
  
  <p>into a Kotlin data class</p>
  
  <pre><code>object Model {
      data class Person(val id: Int, val name: String)
  }
  </code></pre>
  
  <p>However, I'm getting the <code>Expected BEGIN_OBJECT but was BEGIN_ARRAY</code> error when attempting to </p>
  
  <pre><code>@GET("/people.json")
  fun getPeople() : Observable&lt;Model.Person&gt;
  </code></pre>
  
  <p>I've tried changing the <code>Model</code> object to extend from List (as you'd normally do in Retrofit 1 with Java) or creating a <code>List</code> field of people, but to no avail.</p>