-
Notifications
You must be signed in to change notification settings - Fork 3
groovy
ghdrako edited this page Oct 27, 2023
·
3 revisions
https://stackoverflow.com/questions/3049790/can-you-break-from-a-groovy-each-closure
- JsonSlurperJsonSlurper is a class that parses JSON text or reader content into Groovy dataStructures such as maps, lists and primitive types like Integer, Double, Boolean and String.
- JsonOutputThis method is responsible for serialising Groovy objects into JSON strings.
new JsonSlurper().parseText(response.content)
JSON slurper parses text or reader content into a data structure of lists and maps.
def jsonSlurper = new JsonSlurper()
Object lst = jsonSlurper.parseText('{ "List": [2, 3, 4, 5] }')
lst.each { println it }
Test