title: Jackson ObjectMapper removes property which are not declared in abstract or concrete Class
body: <p>I have a Abstact Class say &quot;AbstractChartConfig&quot;.</p>
  <pre><code>// This is abstract class where I have some common properties of a chart and some methods
  @Getter
  @Setter
  public abstract class AbstractChartConfig {
      
      protected String name;
      protected Map&lt;String, Object&gt; type;
      protected Map&lt;String, Object&gt; xAxis;
      protected Map&lt;String, Object&gt; yAxis;
      
      @JsonIgnore
      protected ObjectMapper mapper = new ObjectMapper()
              .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
              .configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true)
              ;
      
      protected abstract void setChartType(Map&lt;String, Object&gt; chartType);
      
      public abstract void parseChart(ChartColDto column, HashMap&lt;String, Object&gt; chartData);
      
  }
  </code></pre>
  <p>And a concrete class</p>
  <pre><code>@Getter
  @Setter
  public class PieChart extends AbstractChartConfig {
      //Implementing the methods here and setting the properties in abstract class
      @Override
      public HashMap&lt;String, Object&gt; parseChart(ChartColDto column, HashMap&lt;String, Object&gt; chartData) {
          HashMap&lt;String, Object&gt; config = column.getConfig();
          setChartType(config.getChartType());
          setXAxis(config.getXAxis());
          setYAxis(config.getYAxis());
          return mapper.convertValue(this, HashMap&lt;String, Object&gt;);
      }
      
      @Override
      protected void setChartType(Map&lt;String, Object&gt; chartType){
          if(null != chartType){
              setType(chartType);
          }
      }
      
  }
  </code></pre>
  <p>And say the config is like</p>
  <pre><code>[
      {
          &quot;config&quot;: {
              &quot;name&quot;: &quot;pie&quot;,
              &quot;chartType&quot;: {
                  &quot;type&quot;: &quot;pie&quot;,
                  &quot;radius&quot;: &quot;10&quot;
              },
              &quot;xAxis&quot;: {
                  &quot;title&quot;: &quot;Some Title&quot;,
                  &quot;fontSize&quot;: &quot;16px&quot;
              },
              &quot;yAxis&quot;: {
                  &quot;title&quot;: &quot;Some Title&quot;,
                  &quot;fontSize&quot;: &quot;16px&quot;
              },
              &quot;zAxis&quot;: {
                  &quot;title&quot;: &quot;Some Title&quot;,
                  &quot;fontSize&quot;: &quot;16px&quot;
              },
              &quot;tooltip&quot;: {
                  &quot;format&quot;: &quot;{point.y}&quot;
              }
          }
      }
  ]
  </code></pre>
  <p>Now, <strong>The Problem</strong> <em>is when mapper is converting the class to HashMap, the properties which are defined in the abstract class is there in the final result but not the one which is not declared i.e, in this case zAxis, tooltip</em></p>
  <p>Now, I know that in order to deserialize the undeclared properties, if I declare them in concrete class it works fine. But that's what I don't want to do. <strong>Is there anyway in which mapper will include the property which is not declared?</strong></p>
  <p>Thanks in advance.</p>