kotools / types

Explicit types for Kotlin Multiplatform.
https://types.kotools.org
MIT License
89 stars 5 forks source link

✨ New `PositiveIntegerAsStringSerializer` type #693

Open LVMVRQUXL opened 1 month ago

LVMVRQUXL commented 1 month ago

πŸ“ Description

We want to add the PositiveIntegerAsStringSerializer experimental type, in the types-kotlinx-serialization subproject, for serializing instances of the PositiveInteger type as String.

class PositiveIntegerAsStringSerializer : KSerializer<PositiveInteger> {
    override val descriptor: SerializerDescriptor

    override fun equals(other: Any?): Boolean
    override fun hashCode(): Int
    override fun serialize(encoder: Encoder, value: PositiveInteger)
    override fun deserialize(decoder: Decoder): PositiveInteger
    override fun toString(): String
}

This serializer should be available for all Kotlin platforms.

πŸ”— Dependencies

This issue is blocked by the following items:

βœ… Checklist