toJson
Writes value of subtype of T to JSON string.
T can be one of the following:
String
Number and its subclasses
Boolean
Enum
Any
T?
Json and its subclasses
class with custom JsonMapper
List
, Sequence , Iterable , Collection , Map class with properties of type T1, T2, ... Tn
Parameters
omitNulls
enables omitting of null properties during class serialization.
Throws
if provided type cannot be written to JSON.
Internal function, use toJson or toJsonRepresentation instead.