emailAddress

Returns the module for serializing the EmailAddress type.


Calling from Kotlin

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)
assertEquals(expected = "\"[email protected]\"", actual = encoded)
val decoded: EmailAddress = format.decodeFromString(encoded)
assertEquals(expected = emailAddress, actual = decoded)