Skip to content

Instantly share code, notes, and snippets.

@felipebizz
Created June 23, 2015 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipebizz/4c0deb73814679ca8196 to your computer and use it in GitHub Desktop.
Save felipebizz/4c0deb73814679ca8196 to your computer and use it in GitHub Desktop.
Create Json With Groovy
def content = [:];
content.expand = 'schema,names';
content.startAt = 0;
content.maxResults = 500
content.total= 7
content.issues =[:];
content.issues = list
def jsonContent = new groovy.json.JsonBuilder(content);
println 'JSON : ' +jsonContent.toString()
Result:
{
content: {
expand: "schema,names",
startAt: 0,
maxResults: 500,
total: 7,
issues: []
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment