0 votes
in DevOps by (19.8k points)

How To Parse And Produce JSON Object In Groovy?

1 Answer

0 votes
by (23.1k points)
Groovy comes with integrated support for converting between Groovy objects and JSON.

The classes dedicated to JSON serialisation and parsing are found in

the groovy.json package.

JsonSlurper is a class that parses JSON text or reader content into Groovy data

structures (objects) such as maps, lists and primitive types

like Integer , Double , Boolean and String .

The class comes with a bunch of overloaded parse methods plus some special methods

such as parseText , parseFile and others
...