title: How to expand and object in JSON body?
body: <p>I have the next classes to have the appropriate json bodies:</p>
  
  <pre><code>public class MyResponse {
  
      private String meta;
      private String info;
  
      private String respOne;
      //...
  }
  </code></pre>
  
  <p>And</p>
  
  <pre><code>public class MyResponseNew {
  
      private String meta;
      private String info;
  
      private String respNew;
      private String respbBest;
  
      //...
  }
  </code></pre>
  
  <p>The JSONs I need: </p>
  
  <pre><code>{
    "meta": "",
    "info": "",
  
    "respOne": ""
  }
  </code></pre>
  
  <p>And</p>
  
  <pre><code>{
    "meta": "",
    "info": "",
  
    "respNew": "",
    "respbBest": ""
  }
  </code></pre>
  
  <p>So, I want to extract general info to one class and have something like this:</p>
  
  <pre><code>public class GeneralSubResponse {
      private String meta;
      private String info;
  
      //..
  
  }
  
  public class MyResponse {
  
      /*@JsonExpanded*/
      private GeneralSubResponse generalInfo;
  
      private String respOne;
  
      //...
  
  }
  </code></pre>
  
  <p>String types - just for examples, there can be any object of any nesting...</p>
  
  <p>Is it possible using Jackson lib? Or is there exist any other way to do something like that? The main concern is to not duplicate code for each Object.</p>