title: Missing field when deserializing using Jackson (Polymorphic)
body: <p>I am trying to create an java SDK for a front-end library that takes JSON input. Essentially, this SDK converts objects of certain type into JSON which is then consumed by that front-end library.</p>
  
  <p>I am using jackson's polymorphic serialization/deserialization using its annotation system.</p>
  
  <p>I have a base class A and 2 child classes B and C extending A. Class A has a type field, using which I decide what class (B or C) is to be used. The syntax looks something like this:</p>
  
  <pre><code>@JsonTypeInfo({
    use = JsonTypeInfo.Id.NAME, 
    include = JsonTypeInfo.As.EXISTING_PROPERTY,
    property= "type"
  })
  @JsonSubTypes({
    @JsonSubTypes.Type(value = B.class, name = "b"),
    @JsonSubTypes.Type(value = C.class, name = "c")
  })
  public class A {
    private String type;
  
    public void setType(String type){
      this.type = type;
    }
  
    public String getType(){
      return this.type;
    }
  }
  
  public class B extends A {
  
  }
  
  public class C extends A {
  
  }
  </code></pre>
  
  <p>So now, when I use Jackson's <code>ObjectMapper</code>'s <code>readValue</code> function and read the stringified JSON and convert to class A, I get the correct instance of either class A or class B based on the value of the type variable. <strong>However</strong>, and here is the actual problem, when I try to use the function <code>getType</code> I always get <code>null</code> in those objects. I am not sure why jackson is not setting those values on the object.</p>
  
  <pre><code>String json = "{ type: 'b' }"; // example input json
  
  ObjectMapper om = new ObjectMapper();
  A a = om.readValue(json, A.class);
  // a is actually an instance of class B
  
  a.getType()// this is null
  </code></pre>