I have a method that returns fairly-nested JSON such as:
[[fizz: buzz, foos: [[count: 4, flim: flam], [count: 6, flim: flume]]]]
When I try to use JsonSlurper
to slurp this JSON into a def result
I am getting exceptions:
// json == “[[fizz: buzz, foos: [[count: 4, flim: flam], [count: 6, flim: flume]]]]"
String json = getJSON()
JsonSlurper slurper = new JsonSlurper()
def result = slurper.parseText(json)
Produces an exception thrown when parseText
executes:
Caught: groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object
Any ideas what the fix is?