title: Retrofit: onFailure: Expected BEGIN_OBJECT but was BEGIN_ARRAY at path $
body: <p>I am writing an android application using retrofit and an laravel backend api.
  My problem is: i want to get back the users with the api, this works fine as it looks in the chrome:inspector, but logcat shows: <strong>onFailure: Expected BEGIN_OBJECT but was BEGIN_ARRAY at path $</strong></p>
  
  <p>my interface:</p>
  
  <pre><code>public interface ApiService {
  
      @POST("register")
      @FormUrlEncoded
      Call&lt;AccessToken&gt; register(@Field("name") String name, @Field("email") String email, @Field("password") String password);
  
      @POST("login")
      @FormUrlEncoded
      Call&lt;AccessToken&gt; login(@Field("username") String username, @Field("password") String password);
  
      @GET("users")
      Call&lt;UserResponse&gt; users();
  
  }
  </code></pre>
  
  <p>My Response Class</p>
  
  <pre><code>import java.util.List;
  
  public class UserResponse {
  
      List&lt;User&gt; data;
  
      public List&lt;User&gt; getData() {
          return data;
      }
  </code></pre>
  
  <p>My user Model</p>
  
  <pre><code>public class User {
  
      int id;
      String name;
      String email;
  
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  }
  </code></pre>
  
  <p>And my api call:</p>
  
  <pre><code>@OnClick(R.id.btn_get_user)
      void getUsers() {
          call = service.users();
          call.enqueue(new Callback&lt;UserResponse&gt;() {
              @Override
              public void onResponse(Call&lt;UserResponse&gt; call, Response&lt;UserResponse&gt; response) {
                  Log.w(TAG, "onResponse: " + response);
  
                  if (response.isSuccessful()) {
                      username.setText(response.body().getData().get(0).getName());
                  } else {
                      startActivity(new Intent(GameActivity.this, LoginActivity.class));
                      finish();
                      tokenManager.deleteToken();
                  }
  
              }
  
              @Override
              public void onFailure(Call&lt;UserResponse&gt; call, Throwable t) {
                  Log.w(TAG, "onFailure: " + t.getMessage());
              }
          });
  
      }
  </code></pre>
  
  <p>Hopefully you can help me.
  Thank you!</p>