Skip to content

Instantly share code, notes, and snippets.

@dbt4u
Created March 27, 2018 22:39
Show Gist options
  • Save dbt4u/bc78884ac08acab7f38fd86f0ec98ffb to your computer and use it in GitHub Desktop.
Save dbt4u/bc78884ac08acab7f38fd86f0ec98ffb to your computer and use it in GitHub Desktop.
Basic JSON Slurper
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