title: Gson JsonObject global variable
body: <p>I'm using Gson API and created a class like:</p>
  
  <pre><code>public class Person
  {
     private String name;
     private JsonObject someInfo;
  
     public Person()
     {
     }
  }
  </code></pre>
  
  <p>When I serealize an instance of this class using:</p>
  
  <pre><code>Person person = new Person();
  person.name = "Charles"
  person.someInfo = new JsonObject();
  person.someInfo.addProperty("key1","value1");
  Gson gson = new Gson();
  String jsonStr = gson.toJson(person);
  </code></pre>
  
  <p>I get the info inside a members properties:</p>
  
  <pre><code>{"members":{"name":"Charles","someInfo":{"key1":"value1"}}}
  </code></pre>
  
  <p>I've noticed that if I declare the Person's class someInfo global variable as JsonElement instead of JsonObject the info is displayed correctly.</p>
  
  <p>Is there any way to serealize the information using JsonObject?</p>
  
  <p>What I expect is:</p>
  
  <pre><code>{"name":"Charles","someInfo":{"key1":"value1"}}
  </code></pre>