I have some JSON I’m trying to parse. I don’t know if this is considered malformed, but a key is empty:
{"value": ["", {"Fields":...}]}
I want to get to the “Fields” element, but I can’t get past the empty string. I’ve tried:
JSON.parse(results).value.@"".Fields
but that returns an error “No such field: empty for class org.codehaus.groovy.grials.web.json.JSONArray.
How can I access “Fields”, or is this just bad json?
It’s not a key, it’s an element in an array. Note the difference between the braces. Simply access the element at index 1 of the array under
value.