title: POJO for nested json
body: <p>i am new on JSON and have a problem on creating POJO for followed JSON input. </p>
  
  <pre><code>    [
      {
  "score":1,
  "popularity":3,
  "name":"Brad Pitt",
  "id":287,
  "biography":"test",
  "url":"http://www.themoviedb.org/person/287",
  "profile":[
      {
          "image":{
              "type":"profile",
              "size":"thumb",
              "height":68,
              "width":45,
              "url":"http://d3gtl9l2a4fn1j.cloudfront.net/t/p/w45/w8zJQuN7tzlm6FY9mfGKihxp3Cb.jpg",
              "id":"4ea5cb8c2c0588394800006f"
          }
      },
      {
          "image":{
              "type":"profile",
              "size":"profile",
              "height":281,
              "width":185,
              "url":"http://d3gtl9l2a4fn1j.cloudfront.net/t/p/w185/w8zJQuN7tzlm6FY9mfGKihxp3Cb.jpg",
              "id":"4ea5cb8c2c0588394800006f"
          }
      },
      {
          "image":{
              "type":"profile",
              "size":"h632",
              "height":632,
              "width":416,
              "url":"http://d3gtl9l2a4fn1j.cloudfront.net/t/p/h632/w8zJQuN7tzlm6FY9mfGKihxp3Cb.jpg",
              "id":"4ea5cb8c2c0588394800006f"
          }
      },
      {
          "image":{
              "type":"profile",
              "size":"original",
              "height":1969,
              "width":1295,
              "url":"http://d3gtl9l2a4fn1j.cloudfront.net/t/p/original/w8zJQuN7tzlm6FY9mfGKihxp3Cb.jpg",
              "id":"4ea5cb8c2c0588394800006f"
          }
      }
  ],
  "version":685,
  "last_modified_at":"2013-02-16 07:11:15 UTC"
    }
    ]
  </code></pre>
  
  <p>i have created three POJO's for this one of them is main person class and this one contains profile object also. Profile object returns image list.:</p>
  
  <pre><code>    public class Person implements Serializable {
  
    private static final long serialVersionUID = 6794898677027141412L;
  
    public String biography;
    public String id;
    public String last_modified_at;
    public String name;
    public String popularity;
    public String score;
    public String url;
    public String version;
    public ArrayList&lt;Profile&gt; profile;
  
    //getters and setters
      }
  
      public class Profile implements Serializable {
  
    private static final long serialVersionUID = -6482559829789740926L;
  
    public ArrayList&lt;Image&gt; image;
  
      }
  
  
      public class Image implements Serializable {
  
      private static final long serialVersionUID = -2428562977284114465L;
  
      public String type;
      public String url;
      public String size;
      public int width;
      public int height;
      }
  </code></pre>
  
  <p>to retrieve data i am using gson:</p>
  
  <pre><code>  Gson gson = new Gson();
    Type collectionType = new TypeToken&lt;List&lt;Person&gt;&gt;(){}.getType();
    List&lt;Person&gt; details = gson.fromJson(json, collectionType);
  </code></pre>
  
  <p>when i run this i got:</p>
  
  <pre><code>  02-17 11:04:50.531: E/AndroidRuntime(405): Caused by:  com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 3
  </code></pre>
  
  <p>updated Image POJO:</p>
  
  <pre><code>public class Image implements Serializable {
  
  private static final long serialVersionUID = -2428562977284114465L;
  private Object image;
  
  public class ImageInner {
  
      public static final String SIZE_ORIGINAL = "original";
      public static final String SIZE_MID = "mid";
      public static final String SIZE_COVER = "cover";
      public static final String SIZE_THUMB = "thumb";
      public static final String TYPE_PROFILE = "profile";
      public static final String TYPE_POSTER = "poster";
      public String type;
      public String url;
      public String size;
      public int width;
      public int height;
  
  }
  }
  </code></pre>
  
  <p>thank you</p>