title: Create Json String manually
body: <p>I'm trying to create a Json structure manually in Java. In the end, I need the a string representation of my Json object. Since my project already has a dependency to GSON, I wanted to use this. But after several hours of trying and googling, I think, I completely misunderstand something.</p>
  
  <p>At the moment, I have the following (non-working) code:</p>
  
  <pre><code>JsonObject user_auth = new JsonObject();
  user_auth.addProperty("user_name", username);
  user_auth.addProperty("password", password);
  JsonObject rest_data = new JsonObject();
  Gson gson = new Gson();
  rest_data.addProperty("user_auth", gson.toJson(user_auth));
  rest_data.addProperty("application", APPLICATION_NAME);
  String payload = gson.toJson(rest_data);
  </code></pre>
  
  <p>The problem I'm facing is that the "user_auth" element gets escaped quotes (\" instead of " when it is added to the outer element. How can I prevent this?
  I also tried to use </p>
  
  <pre><code>rest_data.addProperty("user_auth", user_auth.toString());
  </code></pre>
  
  <p>but this did exactely the same.</p>
  
  <p>Regards,</p>