title: How to unwrap a JsonObject with a single element and keeping JsonObject's name using Jackson library?
body: <p>In my app I have Serie and each one has 2 fields to represent the texture and .obj file.</p>
  
  <pre><code>@Entity
  public class Serie extends Model {
      public File obj;
      public File texture;
  }
  </code></pre>
  
  <p>And my File class:</p>
  
  <pre><code>@Entity
  public class File extends Model{
       public String path;
  }
  </code></pre>
  
  <p>I would like to generate a Json file to describe my objects. As you can see, the File class has exactly one field. For that reason, I wanna generate a Json without JsonArray to describe my file fields. </p>
  
  <p>Using Jackson library, it generates a json like that:</p>
  
  <pre><code>{"obj":{"path":"obj/600s"}, "texture":{"path":"text/600s"}}
  </code></pre>
  
  <p>I would like to generate like that:</p>
  
  <pre><code>{"obj":"obj/600s", "texture":"text/600s"}
  </code></pre>
  
  <p>One option that works partly is use the Jackson's annotation @JsonUnwrapped. </p>
  
  <pre><code>@Entity
  public class Serie extends Model {
  
      @JsonUnwrapped
      public File obj;
  
      public File texture;
  }
  </code></pre>
  
  <p>Using it the Jackson generate a json like that:</p>
  
  <pre><code>    {"path":"obj/600s", "texture":{"path":"text/600s"}}
  </code></pre>
  
  <p>So this does not work for me, because I cannot use for obj, texture fields, and i wanna preserve the fields' names on json.</p>
  
  <p>I know it is a specific question. Any way, thanks in advance</p>