Skip to content
Reference > Methods

parseJson(legalJson)

Definition

Object parseJson(String legalJson)

Description

Returns a nested structure of lists/maps or literals present in the script.

Parameter Definition

Name Type Description
legalJson String json

Examples

1
2
3
4
5
List r1 = parseJson("[1,2,3]"); // r1 == [1, 2, 3]
Map r2 = parseJson("{\"shape\":'cube',\"size\":[1,2,3],\"solid\":true}"); // r2 == {shape=cube, size=[1, 2, 3], solid=true}
Boolean r3 = parseJson("true"); // r3 == true
Integer r4 = parseJson("17"); // r4 == 17
String r5 = parseJson("'red'"); // r5 == red