Firebase JsonMappingException: Can't deserialize instance of java.util.LinkedHashMap out of START_ARRAY token
<p>I run this to mock some data into my firebase reference:</p>

<pre><code>    String id = firebase.push().getKey();
    FirebaseSchool school = new FirebaseSchool(id, "Test school", "Test city", "Test address");
    firebase = firebase.child(id);
    firebase.setValue(school);

    id = firebase.child("rooms").push().getKey();
    FirebaseRoomReference roomReference = new FirebaseRoomReference(id, "Test room", "Test owner");
    firebase.child("rooms").child(id).setValue(roomReference);

    id = firebase.child("rooms").push().getKey();
    FirebaseRoomReference roomReference2 = new FirebaseRoomReference(id, "Test room 2", "Test owner 2");
    firebase.child("rooms").child(id).setValue(roomReference2);
</code></pre>

<p>Which creates the following json:</p>

<pre><code>"schools" : {
    "-K9LoPw-o0dOGAdWYqBF" : {
      "address" : "Test city",
      "city" : "Test address",
      "id" : "-K9LoPw-o0dOGAdWYqBF",
      "name" : "Test school",
      "rooms" : {
        "-K9LoPwDuzW-d19432kD" : {
          "id" : "-K9LoPwDuzW-d19432kD",
          "name" : "Test room",
          "ownerName" : "Test owner"
        },
        "-K9LoPwFPTrwSpUs0dZS" : {
          "id" : "-K9LoPwFPTrwSpUs0dZS",
          "name" : "Test room 2",
          "ownerName" : "Test owner 2"
        }
      }
    }
  }
</code></pre>

<p>as suggested I changed the Map&lt;> to a List&lt;> in my response class:</p>

<pre><code>public class FirebaseSchool {
    private String id;
    private String name;
    private String address;
    private String city;
    private List&lt;FirebaseUserReference&gt; admins;
    private List&lt;FirebaseRoomReference&gt; rooms;


    public List&lt;FirebaseUserReference&gt; getAdmins() {
        return admins;
    }

    public void setAdmins(List&lt;FirebaseUserReference&gt; admins) {
        this.admins = admins;
    }

    public List&lt;FirebaseRoomReference&gt; getRooms() {
        return rooms;
    }

    public void setRooms(List&lt;FirebaseRoomReference&gt; rooms) {
        this.rooms = rooms;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }
}
</code></pre>

<p>but when I try to read a school using <code>snapshot.getValue(FirebaseSchool.class)</code> I get the following error:</p>

<pre><code>com.firebase.client.FirebaseException: Failed to bounce to type
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token at [Source: java.io.StringReader@dbf0e0f; line: 1, column: 44] (through reference chain: com.usehomeroom.vasuki.data.entities.firebase.FirebaseSchool["rooms"])
</code></pre>