title: GSON : Parsing JSON key value with sometime Object & sometime Array
body: <p>I am using GSON for parsing JSON String but there is key contains Json which is sometime object and sometimes array.
   So please help me for parse it to model class using gson.</p>
  
  <blockquote>
    <p>Resonse with Array</p>
  </blockquote>
  
  <pre><code>{
     "key" : "test",
     "value" : [
                  {
                    "id" : 1,
                    "name": "abc"
                  },
                  {
                    "id" : 2,
                    "name": "xyz"
                  }
               ]
  }
  </code></pre>
  
  <blockquote>
    <p>Resonse with Object</p>
  </blockquote>
  
  <pre><code>{
     "key" : "test",
     "value" : {
                   "id" : 1,
                   "name": "abc"
               }
  }
  </code></pre>
  
  <blockquote>
    <p>MyModel.java</p>
  </blockquote>
  
  <pre><code>public class MyModel implements Serializable {
  @SerializedName("key")
  @Expose
  public String key;
  
  @SerializedName("value")
  @Expose
  public ArrayList&lt;ValueModel&gt; value;
  
  public class ValueModel implements Serializable {
      @SerializedName("id")
      @Expose
      public String id;
  
      @SerializedName("name")
      @Expose
      public String name;
     }
  }
  </code></pre>
  
  <p>But it always goto in exeption because of datatype array and object
  I also tried with JsonDeserializer but i think i didnt implement it well
  So please help me to resolve it and parse json</p>