title: How to acquire the Key/name of root level JSON Objects with JSONPath?
body: <p>So I have been using <a href="https://github.com/jayway/JsonPath" rel="nofollow">jayway JSONPath</a> to query JSON Objects much like the following:</p>
  
  <pre><code>{
    "messageHeader" : {
  
       "sentBy" : "someOne",
       "userName" : "John Doe"
    },
  
   "payload" : []
  }
  </code></pre>
  
  <p>And this is working fine for the most part, except now I wish to select the root level objects using the path $..* and preform separate tasks depending on the type of object present in the message, using their key/names as an identifier. 
  However, using said path, or $.* , will always produces a JSONArray much like this:</p>
  
  <p>[{sentBy:someOne,userName:John Doe},[]]</p>
  
  <p>The JSON objects appear to be anonymous, they have no keys. Is there anyway I can access the key for these objects directly as a String? If the data is not present, then why does the path: $.messageHeader.sentBy , work? </p>