I have this JSON body:

```
[
    {
        "id": 0,
        "field1": "10",
        "field2": "22"
    },
    {
        "id": 1,
        "field1": "11",
        "field2": "23"
    }
]

```

My `pojoItem`:

```java
@AutoValue
public abstract class PojoItem{

    @SerializedName("field1")
    public abstract String field1();

    @SerializedName("id")
    public abstract int id();

    @SerializedName("field2")
    public abstract String field2();

}

```

And my `pojoItemList`:

```java
@AutoValue
public abstract class PojoItemList{

    public abstract List< PojoItem > itemList();

    public static TypeAdapter<PojoItemList> typeAdapter(Gson gson) {
        return new AutoValue_PojoItemList.GsonTypeAdapter(gson);
    }
}

```

I have `AutoValueGsonFactory`:

```java
@GsonTypeAdapterFactory
public abstract class AutoValueGsonFactory implements TypeAdapterFactory {

    // Static factory method to access the package
    // private generated implementation
    public static TypeAdapterFactory create() {
        return new AutoValueGson_AutoValueGsonFactory();
    }
}

```

I'm using Retrofit with RxJava. I got this exception:

> 
> java.lang.IllegalStateException: Expected BEGIN\_OBJECT but was BEGIN\_ARRAY
> 
> 
> 

How can I setup my POJO to read JSON as an array of objects not as collection?