title: How to remove nested field of Json object using Gson
body: <p>My <code>JSON</code> response:</p>
  
  <pre><code>{
      "date": 1555044585641,
      "changed": true,
      "data": {
          "items": [
              {
                 "id": 503,
                  "activated": false,
                  "view": {
                      "listItem": {
                          ...
                      },
                      "details": {
                          ...
                      }
                  }       
              }
          ]
      }
  }
  </code></pre>
  
  <p>I am using below class to parse <code>JSON</code> using <code>Gson</code>:</p>
  
  <pre><code>public class Response {
  
      @SerializedName("date")
      public long date;
  
      @SerializedName("changed")
      public boolean changed;
  
      @SerializedName("data")
      public JsonObject data;
  }
  </code></pre>
  
  <p>I save "data" part as a string using <code>data.toString()</code> since data is <code>JsonObject</code>. My question is: </p>
  
  <p><strong>How can I exclude "details" part before saving?</strong> </p>
  
  <p>Saved string should look like:</p>
  
  <pre><code>{
      "items": [
          {
             "id": 503,
              "activated": false,
              "view": {
                  "listItem": {
                      ...
                  }
              }       
          }
      ]
  }
  </code></pre>