Groovy web console

subscribe to the feed Subscribe
to this
site

JsonBuilder example from Groovy 1.8

Published 8 years ago by glaforge with tags json builder groovy18
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
import groovy.json.*

def json = new JsonBuilder()

json.reply {
    result 123
    output "Success"
    stacktrace null
}

println json.toString()