title: Java: Jackson String to Json - Can not deserialize instance of out of START_ARRAY token
body: <p>Getting straight to it...</p>
  
  <p>I have a method that returns a string (see example string below) - essentially, I make a HTTP GET Request to a URL and the response is the string below... </p>
  
  <pre><code>{
    "total": 30,
    "rows": [
      {
        "id": 1,
        "parent": "parentA",
        "children": "childB, childC, childD"
      },
      {
        "id": 2,
        "parent": "parentE",
        "children": "childF, childG, childH"
      },
      {
        "id": 3,
        "parent": "parentI",
        "children": "childJ, childK, childL"
      },
      {
        "id": 4,
        "parent": "parentM",
        "children": "childN, childO"
      },
      {
        "id": 5,
        "parent": "parentP",
        "children": "childQ, childR, childS, childT"
      },
      {
        "id": 6,
        "parent": "parentU",
        "children": "childV, childW, childX"
      },
      {
        "id": 7,
        "parent": "parentY",
        "children": "childZ"
      }
    ]
  }
  </code></pre>
  
  <p>I then assign this string to a variable, then map it to my model...</p>
  
  <pre><code>String strRel = &lt;JSON OBJECT FROM ABOVE&gt;
  ObjectMapper mapper = new ObjectMapper();
  MyModel obj = mapper.readValue(strRel, MyModel.class);
  </code></pre>
  
  <p>However, when I run my code, it, unfortunately, returns the following error...</p>
  
  <pre><code>com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of com.my.models.MyModel out of START_ARRAY token
  </code></pre>
  
  <p>Ultimately, I know what is causing the error, it's the Array of Objects, "rows"...but I am not sure how to fix it. Obviously, I cannot change the schema of the string/object coming back to me.</p>
  
  <p>Any advice will be greatly appreciated.</p>
  
  <p><strong>UPDATE:</strong>
  MyModel</p>
  
  <pre><code>public class MyModel {
      public MyModel() {}
  
      private int total;
      private ModelRows rows;
  
      public int getTotal() { return total; }
      public ModelRows getRows() { return rows; }
  }
  </code></pre>
  
  <p><strong>UPDATE:</strong>
  ModelRows</p>
  
  <pre><code>public class ModelRows {
      public ModelRows() {}
  
      private int id;
      private String parent;
      private String children;
  
      public int getId() { return id; }
  
      public void setId(int id) { this.id = id; }
  
      public String getParent() { return parent; }
  
      public void setParent(String parent) { this.parent = parent; }
  
      public String getChildren() { return children; }
  
      public void setChildren(String children) { this.children = children; }
  }
  </code></pre>