I could not get other answers to work in the evaluation console in Intellij, so ...
groovy.json.JsonOutput.toJson(myObject)
This works fine, but unfortunately
groovy.json.JsonOutput.prettyString(myObject)
didn't work for me.
To make it pretty printed, I had to do it ...
groovy.json.JsonOutput.prettyPrint(groovy.json.JsonOutput.toJson(bookingParams))
chim Mar 13 '17 at 14:15 2017-03-13 14:15
source share