Forum Discussion

cmonroe's avatar
cmonroe
Occasional Contributor
11 years ago

[Resolved] Json Slurper + backslashes + Groovy support

I am running into an issue with JSON slurper where its causing an exception in my script assertion.
My JSON response has back slashes in it and apparently is causing the issue.

There was a defect, apparently filed and fixed: http://jira.codehaus.org/browse/GROOVY- ... l-tabpanel
but that was approximately 2 years ago.

I understand JSON Slurper is not your product, but was curious if any of your engineers have heard of this problem with a Groovy script assertion.

Script Assertion code:
import groovy.json.JsonSlurper
def response = messageExchange.response.responseContent
def slurper = new JsonSlurper()
def json = slurper.parseText response

Output:
Expected a value on line: 1, column: 631.
But got an unterminated object.

I verified the response was valid JSON as well.

Thanks for any thoughts,

Craig

5 Replies