title: Get size or length of json array response (restAssured Response interface)
body: <p>We have REST API automation scripts using RestAssured. In this declared response object as <code>public static Response response;</code> and retrieving the response data using <code>response.jsonPath().get(&quot;id&quot;)</code>, during this trying to even get the size or length of the id, even need to get details about tags array.</p>
  <p>JSON Response:</p>
  <pre><code>   [
    {
      &quot;id&quot;: 1,
      &quot;name&quot;: &quot;test1&quot;,
      &quot;tags&quot;: [
        {
          &quot;tagType&quot;: &quot;details1&quot;,
          &quot;tag&quot;: {
            &quot;description&quot;: null
          }
        }
      ]
    },
    {
      &quot;id&quot;: 2,
      &quot;name&quot;: &quot;test2&quot;,
      &quot;tags&quot;: [
        {
          &quot;tagType&quot;: &quot;details2&quot;,
          &quot;tag&quot;: {
            &quot;description&quot;: null
          }
        }
      ]
    }
  ]
  </code></pre>
  <p>Tried below ways:</p>
  <p><code>public static Response response;</code></p>
  <pre><code>List&lt;String&gt; resIDs = response.jsonPath().get(&quot;id&quot;);
  
  System.err.println(&quot;Retrieved IDs from Response: &quot; + resIDs);
  
  O/P: is [1,2,3,4,5,6,7]
  
  Tried as resIDs.size(), that also no response printed.
  
  List&lt;Object&gt; size = response.jsonPath().getList(&quot;$&quot;);
  
  System.err.println(&quot;ArraySize for IDs from Response: &quot; + size);
  </code></pre>
  <p>or</p>
  <pre><code>int size = response.jsonPath().getList(&quot;$&quot;).size();
  
  O/P: Not printed/nothing shown
  </code></pre>
  <p>Please guide how to get the size/length.</p>