title: Java deserialise json to implementation of abstract object open closed principle
body: <p>I have polymorphic types of Varchar, Integer and Float that extend a base class.</p>
  
  <p>I have had to add the following to the base class so I can use it in a rest api.</p>
  
  <pre><code>@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
  @JsonSubTypes({
          @JsonSubTypes.Type(name = "VarcharField", value = VarcharField.class),
          @JsonSubTypes.Type(name = "IntegerField", value = IntegerField.class),
          @JsonSubTypes.Type(name = "FloatField", value = FloatField.class)
  })
  public abstract class Field&lt;T&gt; implements FieldType&lt;T&gt;, Serializable {
  </code></pre>
  
  <p>My issue with this is that it breaks the open closed principle, is there anyway to get around this, an external config perhaps?</p>