Groovy web console

subscribe to the feed Subscribe
to this

Evaluate Groovy JSON

Published 2 weeks ago by Gaurav Khare with tags json updateJson
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
import groovy.json.*
def jsonSlurper = new JsonSlurper()
def object = jsonSlurper.parseText('{ "name": "John Doe" } /* some comment */') = 'abc'

def jsonStr = JsonOutput.toJson(object)