klyn.Object.fromJson
method
public static fromJson<T>(json as String) as T
Description

Deserializes JSON into the requested static type.

Parameters
ParameterDescription
jsonJSON document to read.
Returns

The deserialized value of type T.

Throws
  • JSONParseException if the document is not valid JSON.
Example
class Point:
    public x as Int
    public y as Int

point = Object.fromJson<Point>("{\"x\": 10, \"y\": 20}")
print(point.x)