klyn.io.json.JSON.parse
method

    public static parse(json as String) as Object:

Description

Parses JSON text into its natural Klyn representation.

JSON objects become maps, arrays become array lists, and scalar values retain their corresponding primitive type.

Parameters

Parameter | Description
--- | ---
`json` | JSON document to parse.

Returns

Parsed map, list, scalar value, or `null`.

Throws

- JSONParseException if the document is malformed.

Example

    value = JSON.parse("""{"numerator": 1, "denominator": 3}""")
    assert value is Map