title: How to access a JSON Array response using JsonPath?
body: <p>How to handle when REST service response is returned as Json Array:  for e.g:</p>
  
  <pre><code>[{"boolField":true,"intField":991, "StringField":"SampleString"},
   {"boolField":false, "intField":998, "StringField": "SampleString2"}]";
  </code></pre>
  
  <p>All the blogs &amp; examples I have seen didn't deal with the scenario mentioned above. For example, I went through <a href="http://goessner.net/articles/JsonPath/" rel="nofollow">http://goessner.net/articles/JsonPath/</a> expression syntax, but couldn't locate the solution.</p>
  
  <p>For example the following json, if I want to get all the authors, I can use <code>$.store.book[*].author</code>  or <code>$..author</code></p>
  
  <pre><code>{ "store": {
      "book": [ 
        { "category": "reference",
          "author": "Nigel Rees",
          "title": "Sayings of the Century",
          "price": 8.95
        },
        { "category": "fiction",
          "author": "Evelyn Waugh",
          "title": "Sword of Honour",
          "price": 12.99
        }]}
  }
  </code></pre>
  
  <p>However, if the REST service response is returned like below, then how to get all authors from the list</p>
  
  <pre><code>[
    { "category": "reference",
      "author": "Nigel Rees",
      "title": "Sayings of the Century",
      "price": 8.95
    },
    { "category": "fiction",
      "author": "Evelyn Waugh",
      "title": "Sword of Honour",
      "price": 12.99
     }
  ]
  </code></pre>