Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.0
-
None
Description
Currently this code:
def myObject = new MyObject() def json = new JsonBuilder(); json myObject; println JsonOutput.prettyPrint(json.toString())
Prints something like:
[
"MyObject@28db23f1"
]
My suggestion:
Introspect the object and transfer each property to json, with recursive calls for objects.
Having looked at JsonOutput.groovy and the toJson(object) method this should be easy to implement and hugely useful!