string

fun <T> string(value: T, serializer: KSerializer<T>): String(source)

Serializes the given value of type T into its JSON string representation using the specified serializer.

Return

A JSON string representation of the given value.

Parameters

T

The type of the value to serialize.

value

The value to be serialized into JSON.

serializer

The serializer used to convert the value of type T into a JSON string.


inline fun <T> string(value: T): String(source)

Serializes a given value of type T into its JSON string representation using the default serializer.

Return

A JSON string representation of the provided value.

Parameters

T

The type of the object to be serialized.

value

The value to be serialized into a JSON string.