Created
March 27, 2018 22:39
-
-
Save dbt4u/bc78884ac08acab7f38fd86f0ec98ffb to your computer and use it in GitHub Desktop.
Basic JSON Slurper
This file contains hidden or 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.* | |
import groovy.text.* | |
def restResponse = new File("attributes.json") //later via Rest-Call .parse(URI) | |
def js = """${restResponse.text}""" | |
def data = new JsonSlurper().parseText(js) | |
def totalCount = data.size | |
data.each { | |
println it["Name"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment