BooleanEnumSerializer

Custom serializer for boolean enum fields that converts JsonElement values to Boolean during deserialization.

During deserialization:

  • JsonPrimitive booleans → value directly

  • JsonPrimitive strings → parsed to Boolean ("true"/"false")

  • JsonPrimitive numbers → non-zero = true, zero = false

  • Other types → error

During serialization, converts List back to JsonArray of JsonPrimitive booleans.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

Link copied to clipboard
open override fun deserialize(decoder: Decoder): List<Boolean>?
Link copied to clipboard
open override fun serialize(encoder: Encoder, value: List<Boolean>?)