grails - Evaluating a path in json from groovy - list elements are no longer returned as string -
i've got tests api within framework written in grails, , part of tests evaluate paths in json @ run-time.
the json looks bit (really hope i've got brackets right!):
{"someid":"big id here", "structure": [ {"name": "item1", "questions":[ {"name":"question1","answers":["i cake"]} ] } ] }
it's read in via:
json.parse(this.response.tostring())
i evaluate paths using
eval.x(jsonvariable, 'x.' + pathvariable)
where pathvariable example path below. problem occurs when try return/check list.
an example path is
structure.find{it['name']=='item1'}.questions.find{it['name']=='question1'}.answers
a couple of days ago happily on grails 2.2.4 , worked fine. got back
["i cake"]
i've upgraded 2.3.2 , get
[i cake]
i've checked api directly it's still returning valid json, it's parsing that's issue. i'm reluctant rewrite tests there's lots of them , (more importantly) rewriting them check incorrect value, makes me uncomfortable.
is there work-around behaviour? missing something?
Comments
Post a Comment