Class KotlinSerializationJsonEncoder

java.lang.Object
org.springframework.http.codec.KotlinSerializationSupport<T>
org.springframework.http.codec.KotlinSerializationStringEncoder<kotlinx.serialization.json.Json>
org.springframework.http.codec.json.KotlinSerializationJsonEncoder
All Implemented Interfaces:
Encoder<Object>

public class KotlinSerializationJsonEncoder extends KotlinSerializationStringEncoder<kotlinx.serialization.json.Json>
Encode from an Object stream to a byte stream of JSON objects using kotlinx.serialization.

This encoder can be used to bind @Serializable Kotlin classes, open polymorphic serialization is not supported. It supports application/json and application/*+json with various character sets, UTF-8 being the default.

Since:
5.3
Author:
Sebastien Deleuze, Iain Henderson
  • Constructor Details

    • KotlinSerializationJsonEncoder

      public KotlinSerializationJsonEncoder()
    • KotlinSerializationJsonEncoder

      public KotlinSerializationJsonEncoder(kotlinx.serialization.json.Json json)