Groovy web console

subscribe to the feed Subscribe
to this
site

Untitled

Published 4 months ago by Anonymous
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
import groovy.json.*
def json_req = '''{
  "foo": {
    "bar": "baz"
  }
}'''
 
def json = new JsonSlurper().parseText(json_req)
println json.getClass().getName()
json.foo.qux = "lol"
println JsonOutput.toJson(json)