kotools/types

โœจ New `EmailAddressAsStringSerializer` type

LVMVRQUXL opened this issue ยท 0 comments

๐Ÿ“ Description

In the types-kotlinx-serialization subproject, we want to introduce the EmailAddressAsStringSerializer experimental type for serializing the EmailAddress type as String. This serializer should be available for all Kotlin platforms.

class EmailAddressAsStringSerializer : KSerializer<EmailAddress> {
    override val descriptor: SerializerDescriptor

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

Finally, we want to deprecate the KotoolsTypesSerializers.emailAddress experimental property with an error level for using this new serializer instead.

โœ… Checklist

  • โœจ Add the type and its primary constructor with documentation, samples and tests.
  • โœจ Override the toString() function with documentation, samples and tests.
  • โœจ Override the equals(Any?) function with documentation, samples and tests.
  • โœจ Override the hashCode() function with documentation, samples and tests.
  • โœจ Make the type implementing the KSerializer<EmailAddress> type with documentation, samples and tests.
  • ๐Ÿ—‘๏ธ Deprecate the KotoolsTypesSerializers.emailAddress property.
  • ๐Ÿ“ Update the unreleased changelog for this issue.
  • ๐Ÿ“ Create another issue for removing the KotoolsTypesSerializers.emailAddress deprecated property for the next iteration.