Package io.ktor.serialization

Types

Link copied to clipboard
class SerializationConverter : ContentConverter

ContentConverter with kotlinx.serialization.

Functions

Link copied to clipboard
fun ContentNegotiation.Configuration.json(json: Json = DefaultJson, contentType: ContentType = ContentType.Application.Json)
fun ContentNegotiation.Configuration.json(json: Json = Json.Default, module: SerializersModule = EmptySerializersModule, contentType: ContentType = ContentType.Application.Json)

Register application/json (or another specified contentType) content type to ContentNegotiation feature using kotlinx.serialization.

Link copied to clipboard
fun ContentNegotiation.Configuration.serialization()
fun ContentNegotiation.Configuration.serialization(contentType: ContentType)
fun ContentNegotiation.Configuration.serialization(contentType: ContentType, json: Json)

Register kotlinx.serialization converter into ContentNegotiation feature

fun ContentNegotiation.Configuration.serialization(contentType: ContentType, format: BinaryFormat)

Register kotlinx.serialization converter into ContentNegotiation feature with the specified contentType and binary format (such as CBOR, ProtoBuf)

fun ContentNegotiation.Configuration.serialization(contentType: ContentType, format: StringFormat)

Register kotlinx.serialization converter into ContentNegotiation feature with the specified contentType and string format (such as Json)

Link copied to clipboard
@JvmName(name = "serialization")
fun ContentNegotiation.Configuration.serialization0(contentType: ContentType = ContentType.Application.Json, json: Json = DefaultJson)
Link copied to clipboard
fun SerializationConverter(): SerializationConverter

This is no longer supported. Instead, specify format explicitly or use the corresponding DSL function.

Properties

Link copied to clipboard
val DefaultJson: Json

The default json configuration used in SerializationConverter. The settings are:

Link copied to clipboard
val DefaultJsonConfiguration: Json

The default json configuration used in SerializationConverter. The settings are: