title: iterating through JSON objects in groovy using maps
body: <pre><code>    import com.avoka.component.http.GetRequest
      import groovy.json.JsonOutput
      import groovy.json.JsonSlurper
      import org.apache.http.client.methods.CloseableHttpResponse
      import org.apache.http.client.methods.HttpGet
      import org.apache.http.client.utils.URIBuilder
      import org.apache.http.impl.client.CloseableHttpClient
      import org.apache.http.impl.client.HttpClients
      import org.apache.http.util.EntityUtils
  
  
      CloseableHttpClient client = HttpClients.createDefault();
      def uri = new URIBuilder("https://randomuser.me/api/?results=30&amp;nat=US")
      HttpGet request = new HttpGet(uri.build())
      request.setHeader("content-type", "application/json")
      CloseableHttpResponse response = client.execute(request);
      String json = EntityUtils.toString(response.getEntity());
      def jsonSlurper = new JsonSlurper()
      def object = jsonSlurper.parseText(json)
      def users =[:]
      for (int i =0 ; i&lt; object.results.size() ; i++){
          def contactJson = object.results[i]
  
          users.gender = contactJson.gender
         users.firstname =contactJson.name.first
          users.lastname =contactJson.name.last
          users.location = contactJson.location.collect { it -&gt;
  
              [Street  : it.street,
               city  : it.city,
               state  : it.state,
               postcode : it.postcode]
  
          }
          users.phone =contactJson.phone
          users.dateofbirth = contactJson.dob.age
          users.nationality =contactJson.nat
      }
      print users
  
  I am looping the json object and trying to populate the response using maps. 
   Caught: groovy.lang.MissingPropertyException: No such property: street for class: java.util.LinkedHashMap$Entry
  </code></pre>
  
  <p>groovy.lang.MissingPropertyException: No such property: street for class: java.util.LinkedHashMap$Entry
      at post$_run_closure1.doCall(post.groovy:33)
      at post.run(post.groovy:31)  </p>
  
  <p>Getting this error and also i am getting a single user in the print user but the list has the size of 30.   </p>