fromJson

inline fun <T> fromJson(input: String): T

Parses JSON from input string as type T.

T can be one of the following:

  • String

  • Number and its subclasses

  • Boolean

  • Enum class

  • Any

  • Json and its subclasses

  • T?

  • List, Sequence, Iterable, Collection, Map

  • class with primary constructor with args of type T1, T2, ... Tn

Throws

if parsing error was occurred


fun fromJson(json: Json, type: KType, key: String? = null): Any?

Internal function, use fromJson or fromJsonRepresentation instead.