emailAddress
Returns the module for serializing the EmailAddress type.
Here's an example of calling this property from Kotlin code:
val format = Json {
serializersModule = KotoolsTypesSerializers.emailAddress
}
val emailAddress: EmailAddress =
EmailAddress.fromString("[email protected]")
val encoded: String = format.encodeToString(emailAddress)
println(encoded) // "[email protected]"
val decoded: EmailAddress = format.decodeFromString(encoded)
println(emailAddress == decoded) // true
Content copied to clipboard