kotlinx-serialization / kotlinx.serialization.json / Json / context

context

(common, js, jvm, native) val context: SerialModule

Contains all serializers registered by format user for ContextualSerialization and Polymorphic serialization.

The same context should be exposed in the format's Encoder and Decoder.

(common, js, jvm, native) val context: SerialModule fun <T> stringify(serializer: SerializationStrategy<T>, value: T): String fun <T> parse(deserializer: DeserializationStrategy<T>, string: String): T fun <T> toJson(serializer: SerializationStrategy<T>, value: T): JsonElement fun <reified T : Any> toJson(value: T): JsonElement fun parseJson(string: String): JsonElement fun <T> fromJson(deserializer: DeserializationStrategy<T>, json: JsonElement): T fun <reified T : Any> fromJson(tree: JsonElement): T(common, js, jvm, native)

Contains all serializers registered by format user for ContextualSerialization and Polymorphic serialization.

The same context should be exposed in the format's Encoder and Decoder.

(common, js, jvm, native)

Serializes value to String using given serializer.

(common, js, jvm, native)

Deserializes given string to an object of type T using given deserializer.