open-force / jsonparse

Apex JSON parser to make it easier to extract information from nested JSON structures
MIT License
137 stars 30 forks source link

Root Node Array Exception #1

Closed cmatos23 closed 5 years ago

cmatos23 commented 5 years ago

If the root node is an Array, then an exception is thrown.

new JSONParse(json).get('root[0]')

The above code fails with No match found for <root[0]>

I'm able to work around this by doing new JSONParse(json).get('root').get('[0]').

cmatos23 commented 5 years ago

Okay, I figured out the issue. The proper syntax is root.[0] . User error :)