title: How to Parse JSON Array(String) with Gson
body: <p>I want to parse string JSON arrays to VO and using gson.</p>
  <p>PostMan RequestBody Call my TestApi:</p>
  <pre><code>{&quot;data&quot;: &quot;[{\&quot;id\&quot;:\&quot;1\&quot;,\&quot;name\&quot;:\&quot;james\&quot;,\&quot;passwd\&quot;:\&quot;abcd\&quot;},{\&quot;id\&quot;:\&quot;2\&quot;,\&quot;name\&quot;:\&quot;john\&quot;,\&quot;passwd\&quot;:\&quot;dcba\&quot;},{\&quot;id\&quot;:\&quot;3\&quot;,\&quot;name\&quot;:\&quot;mike\&quot;,\&quot;passwd\&quot;:\&quot;opppt\&quot;}]&quot;}
  </code></pre>
  <p>My VO Class :</p>
  <pre><code>@Data
  public class TestVo {
      private String id;
      private String name;
      private String passwd;
  }
  </code></pre>
  <p>I tried this Code :</p>
  <pre><code>@PostMapping(value = &quot;/testApi&quot;)
  public void testApi(@RequestBody String data){
  
      Gson gson = new Gson();
  
      JsonElement jsonElement = gson.fromJson(data, JsonElement.class);
  
      String jsonStr = jsonElement.getAsJsonObject().get(&quot;data&quot;).getAsString();
  
      List&lt;TestVo&gt; list = gson.fromJson(jsonStr, new TypeToken&lt;List&lt;TestVo&gt;&gt;(){}.getType());
  .
  .
  .
  </code></pre>
  <p><strong>Output</strong></p>
  <blockquote>
  <p>Expected a string but was BEGIN_ARRAY at line 1 column ..... Error T.T</p>
  </blockquote>