title: Jackson serialize the child class as fields in parent class
body: <p>I am trying to obtain the following effect. </p>
  
  <pre><code>class Foo{
      public Bar bar;
      public int f1 = 1;
  }
  
  public class Bar{
      public int b1;
      public int b2;
  }
  </code></pre>
  
  <p>If you serialize this to JSON you will get</p>
  
  <pre><code>{ "bar" : {
                "b1" : 1,
                "b2" : 2,
            },
     "f1" : 0
  }
  </code></pre>
  
  <p>But I am loking on the Jackson annotations to have it written as</p>
  
  <pre><code>{  
     "b1" : 1,
     "b2" : 2,        
     "f1" : 0
  }
  </code></pre>
  
  <p>Basically you do not serialize the field as a separate class, but rather pull the fields to its parent object in the tree.</p>
  
  <p>I know that this could be done with a custom serializer, but I am curios if there is a simple annotation style for this. (For a single field I could have annotated with <code>@JsonValue</code>)</p>