ktor-serialization / io.ktor.serialization / io.ktor.features.ContentNegotiation.Configuration

Extensions for io.ktor.features.ContentNegotiation.Configuration

json

fun Configuration.json(json: Json = Json.Default, module: SerializersModule = EmptySerializersModule, contentType: ContentType = ContentType.Application.Json): Unit
fun Configuration.json(json: Json = DefaultJson, contentType: ContentType = ContentType.Application.Json): Unit

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

serialization

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

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

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

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

fun Configuration.serialization(): Unit
fun Configuration.serialization(contentType: ContentType): Unit
fun Configuration.serialization(contentType: ContentType, json: Json): Unit

Register kotlinx.serialization converter into ContentNegotiation feature

serialization0

fun Configuration.serialization0(contentType: ContentType = ContentType.Application.Json, json: Json = DefaultJson): Unit