SerializationConverter

fun SerializationConverter(format: BinaryFormat)

Creates a converter serializing with the specified binary format.


fun SerializationConverter(format: StringFormat, defaultCharset: Charset = Charsets.UTF_8)

Creates a converter serializing with the specified string format and defaultCharset (optional, usually it is UTF-8).


fun SerializationConverter(json: Json = DefaultJson)


fun SerializationConverter()

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

install(ContentNegotiation) {
json() // json with the default config
json(Json.strict) // strict json
register(..., SerializationConverter(Json(Json.nonstrict)) // more generic and longer way
}