Last active
August 29, 2015 14:06
-
-
Save joasgarcia/7fe892d4b0ddca5118fe to your computer and use it in GitHub Desktop.
Transformar um Map do Groovy para uma string JSON formatada
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.json.JsonBuilder | |
def data = [ | |
dealDate: new Date().format("yyyy-MM-dd"), | |
contactId:17628473, | |
dealTypeId:4698155, | |
items:[[quantity:1, rate:74.0, itemId:17214256]], | |
total:74.0 | |
] | |
println new JsonBuilder(data).toPrettyString() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment