title: JSON to Groovy with JsonSlurper and unknown "string"
body: <p>I am writing a Grails/Groovy app and I have a JSON object with a "string" name (<strong>grommet</strong> and <strong>widget</strong>) inside the <strong>params</strong> member that can change. That is, next time it might be <strong>acme</strong> and <strong>zoom</strong>. Here is the JSON:</p>
  
  <pre><code>def jx = """{ 
      "job": "42",
      "params": {
          "grommet": {"name": "x", "data": "y"},
          "widget": { "name": "a", "data": "b"}
      } 
  }"""
  </code></pre>
  
  <p>I am trying to figure out how to get the string <strong>grommet</strong> . Code so far:</p>
  
  <pre><code>def dalist = new JsonSlurper().parseText(jx)
  println dalist.job     // Gives: 42
  println dalist.params  // Gives: [grommet:[name:x, data:y], widget:[name:a, data:b]]
  println dalist.params[0]  // Gives: null
  </code></pre>
  
  <p>Any idea how to get the string <strong>grommet</strong>? Iama going to keep hitting my head against a wall.</p>