title: How to create json object with key and value, where value is array
body: <p>I need to make json object with key, and value, where value is array of values. How could i do that ? </p>
  
  <pre><code>{"propName" : "favouriteObjectsIds", 
   "value": [
          "5c93f4cc3a6565000483248d",
          "5c93f7843a6565000483248e"
          ] 
  }
  </code></pre>
  
  <p>I have tried like this </p>
  
  <pre><code>public void add(String propertyName, String[] values){
          JsonArray array1 = new JsonArray();
          for(int i = 0; i &lt; values.length; i++){
              array.add(values[i]);
          }
  
          JsonObject json = new JsonObject();
          json.addProperty("propName", propertyName);
          json.addProperty("value" ,array.toString());
      }
  </code></pre>
  
  <p>but array.toString() gives me such output</p>
  
  <pre><code>{"propName":"favouriteObjectsIds",
  "value":"[\"5c93f4cc3a6565000483248d\",\"5c9b82ad24b33b0004227322\"]"}
  </code></pre>