Forum Discussion
9 Replies
- nmraoCommunity Hero
First of all thank you for mentioning the class JsonUtil, never happened to see that.
It appears the class is available in Open Source Edition 5.1.2 onwards.
Here is the little script created using JsonUtil class and got the output successfully.
import com.eviware.soapui.support.JsonUtil def json = """{ "parent":{ "child":"oldValue" } }""" log.info JsonUtil.isValidJson(json)
- KyleChenNew Contributor
Hi nmrao
my code is as below
import com.eviware.soapui.support.JsonUtil //I add your suggestions
def response = context.expand( '$My API response' )
def jsonObj = JsonUtils.getJsonObj(response)and still shows the error
My version is (on Mac OS)
SoapUI 5.3.0
Copyright (C) 2004-2017 smartbear.com
http://www.soapui.org | http://www.smartbear.com
Build Date: 20161130-0556Thanks!
- nmraoCommunity Hero
1. Your second statement is invalid, it seems.
2. There is no such class JsonUtils. It is JsonUtil. However, there is no "getJsonObj" method as well in JsonUtil.
Please have a look at the javadoc:
https://www.soapui.org/apidocs/index.html
- nmraoCommunity HeroOk.
May be you can try to open SOAPUI_HOME/bin/soapui-xxx.jar file and see if that class is present.
Also, it would be good if you can say your use case.