serialize

fun <T> T.serialize(serializer: KSerializer<T>, format: StringFormat = jsonForMachines): String

Serializes this object to a string using the specified serializer and format.

Return

The serialized string representation of this object.

Parameters

serializer

The KSerializer to use for serialization.

format

The StringFormat to use for encoding (default: jsonForMachines).

See also