title: Deserialize multi level polymorphic subtypes using jackson annotations
body: <p>I want to deserialize 2 level polymorphic subtypes using jackson annotations.
  Basically I want to convert following json to xml using json annotations and jacksons as follows</p>
  
  <pre><code>{
    "mainSet": {
      "name": "bla bla",
      "myItems": [
        {
          "MySubItem": {
            "id": 1,
            "name": "Value1",
            "itemAProperty1": "Some stuff",
            "itemAProperty2": "Another property value",
            "type": "MySubItemA"
          }
        },
        {
          "MySubItem": {
            "id": 2,
            "name": "Value2",
            "itemBProperty1": 1000,
            "itemBProperty2": "B property",
            "type": "MySubItemB"
          }
        }
      ]
    }
  }
  </code></pre>
  
  <p>And Final Xml i want is </p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;mainTag schemaVersion="1" xmlns="http://www.utiba.com/xml/ns/brms/v1"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
      &lt;name&gt;bla bla&lt;/name&gt;
      &lt;MySubItem xsi:type="MySubItemA" id="1" name="value1" itemAProperty1="Some stuff" itemAProperty2="Another property value"/&gt;
      &lt;MySubItem xsi:type="MySubItemB" id="2" name="value2" itemAProperty1=1000 itemAProperty2="B Property"/&gt;
  &lt;/mainTag&gt;
  </code></pre>
  
  <p>I have following set of classes - Main class</p>
  
  <pre><code>public abstract class MyItem {
  
  private int id;
  private String name;
   //getter and setter
  }
  </code></pre>
  
  <p>Its having abstract subclass</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "MySubItem")
  @XmlSeeAlso({
      MySubItemA.class,
      MySubItemB.class,
      MySubItemC.class
  })
      public abstract class MySubItem extends MyItem {
  
      private String itemAProperty1;
      private String itemAProperty2;
       //getter and setter
      }
  </code></pre>
  
  <p>And MySubItem have concrete subclases say
  <strong>MySubItemA,MySubItemB, MySubItemC</strong></p>
  
  <p>Now Finally, we create a client class that contains a list of objects of the abstract class</p>
  
  <pre><code> import java.util.ArrayList;
      import java.util.List;
  
      public class MainSet{
       @XmlElements({
          @XmlElement(name = "MysubItem", type = MySubItem.class),
      })
      private List&lt;MyItem&gt; myItems;
  
        public List&lt;MyItem&gt; getMyItems() {
          return this.myItems;
      }
      }
  </code></pre>
  
  <p>I tried creating Mixin classes for MyItem as </p>
  
  <pre><code>@JsonTypeInfo(use=Id.MINIMAL_CLASS, include=As.PROPERTY, property="itemType")
  @JsonSubTypes({
     @Type(MySubItem.class)
  })
  </code></pre>
  
  <p>And for and MySubItem</p>
  
  <pre><code>@JsonTypeInfo(use=Id.MINIMAL_CLASS, include=As.PROPERTY, property="type")
  @JsonSubTypes({
     @Type(MySubItemA.class)
     @Type(MySubItemB.class)
     @Type(MySubItemC.class)
  })
  </code></pre>
  
  <p>Error i am getting is :</p>
  
  <pre><code>Error parsing JSON from client: com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of MySubItem, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information
   at [Source: java.io.StringReader@26bd8952; line: 1, column: 498] (through reference chain: bla bla class ["mainSet"]-&gt;com.bla.bla["myItems"])
  </code></pre>
  
  <p>ISSUE : create mixin class for myItems list, having 2 level of abstract subclasses hierarchy</p>