Groovy web console

subscribe to the feed Subscribe
to this
site

JSON creator

Published 2 months ago by BMH
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
import groovy.json.*
def map = [
            name:[first:'Winona',last:'Hart'],
            previousName:[first:'Winona',last:'Ryder'],
            licensee_id:'104-61-2132',
            id:UUID.randomUUID(),
            event_id:UUID.randomUUID(),
            effective:new Date()
          ]
def mapAsJson = JsonOutput.toJson(map)
JsonOutput.prettyPrint(mapAsJson)