title: Deserialize a list of objects with Jackson
body: <p>I have a List of objects each of them has specified fields(type of variable) so i thought that i will create a main class(super class) with the shared elements(variables) and two subclasses for the specific type of variables.
  I want to deserialize all of Subclasses as the Type of the superclass so that i can put all of this Jsons in List of the same objects.</p>
  <p>Here is an example of my Json</p>
  <blockquote>
  <p>[   { &quot;query&quot;: &quot;age&quot;,        &quot;type&quot;: &quot;numeric&quot;, &quot;min&quot;: 5, &quot;max&quot;: 99 },
  { &quot;query&quot;: &quot;diagnosis&quot;,  &quot;type&quot;: &quot;string&quot;,  &quot;in&quot;: [&quot;husten&quot;,
  &quot;schnupfen&quot;] } ]</p>
  </blockquote>
  <p>the code i wrote to deserialize this is:</p>
  <pre><code>public class Query{
      private String query;
      private String type;
      // Getters and Setters and constructor
  }
  
  public class QueryString extends Query implements Serializable {
      private List&lt;String&gt; in;
      private String like;
      // Getters and Setters and constructor
  }
  
  public class QueryNum extends Field implements Serializable {
      private Number min;
      private Number max;
      // Getters and Setters and constructor
  }
  </code></pre>
  <p>The serialization using ObjectMapper is working as expected but the by deserialization the compiler gives me that there is an unrecognized values ( which are the fields of my sublasses).</p>
  <p>I want to get a List of objects(Query)
  List which contains QueryString and QueryNum.</p>
  <p>is that possible with Jackson Json in Java ?</p>
  <p>for the desrialization i used :</p>
  <blockquote>
  <pre><code>    ObjectMapper mapper = new ObjectMapper();
  
      List&lt;Query&gt; queries= Arrays.asList(mapper.readValue(JsonString, Query[].class));
  </code></pre>
  </blockquote>
  <p>Thanks in advance</p>