Read JSON file in a Groovy using JSON Slurper
Groovy Tutorial: Read JSON file in a Groovy using JSON Slurper
04:27 Simple example of JSON parsing in Groovy using `JsonSlurper`, Convert text data to JSON
10:14 Read JSON text which has Array in a Groovy
13:21 Read text which has different datatype in a Groovy
15:10 Read JSON from a text file from a computer in Groovy
19:31 Read JSON from a URL in a Groovy
15:27 Read JSON from a URL in a Groovy
25:28 Handling not so proper JSON (LAX JSON) in a Groovy:
Listen with 1.25 speed to save the time
------------------------------------------
This is the first video in the series of Parsing and Producing JSON in Groovy.
After watching this video, you will understand How to convert JSON to a groovy object using JsonSlurper.
First Thing First: Why you may need to convert JSON to Groovy object?
== Understanding Groovy is important as it is used in the different API tools like JMeter, Soap-UI and Kotlin and while chaining the APIs in this often we have to extract data from response of the previous request, manipulate it as per requirement and send it in next request data.
Most of the modern-day web development framework relies on JSON as a data type to send the data to the client.
Manipulating this data as text data is hard, tedious, error-prone and time-consuming but if we convert it to Groovy Object it becomes easy. Let's Understand first Some Groovy’s love for JSON
----------------------------------------------------------------------