JsonSerializer

interface JsonSerializer

Client json serializer.

Functions

read

abstract fun read(type: TypeInfo, body: Input): Any

Read content from response using information specified in type.

write

abstract fun write(
    data: Any,
    contentType: ContentType
): OutgoingContent
open fun write(data: Any): OutgoingContent

Convert data object to OutgoingContent.

Inheritors

GsonSerializer

class GsonSerializer : JsonSerializer

JsonSerializer using Gson as backend.

JacksonSerializer

class JacksonSerializer : JsonSerializer

KotlinxSerializer

class KotlinxSerializer : JsonSerializer

A JsonSerializer implemented for kotlinx Serializable classes. Since serializers are determined statically, you must set the mapping for each Serializable class to it’s KSerializer manually, using setMapper or register.