title: Remove empty JSON objects from an array in Jackson serialization
body: <p>I have a List in a Java Pojo class. That list contains some MyChildPojo objects which are not null but can have properties with null values. Example:</p>
  
  <pre><code>MyChildPojo obj1 = new MyChildPojo();
  MyChildPojo obj2 = new MyChildPojo();
  </code></pre>
  
  <p>I have added <code>@JsonInclude(JsonInclude.Include.NON_EMPTY)</code> on my MyChildPojo class so null properties will not be added while serializing the object.
  Now my final serialized output for the List object is:</p>
  
  <pre><code>[
    {}, {}
  ]
  </code></pre>
  
  <p>I want to remove the complete List object in this case. I have tried by adding <code>@JsonInclude(JsonInclude.Include.NON_EMPTY)</code> and <code>@JsonInclude(value = Include.NON_EMPTY, content = Include.NON_EMPTY)</code> on the List object but still getting the same output.</p>
  
  <p>I can only use annotation in my case. Is there any possible way to do this?</p>