zero
Returns the module for serializing the Zero type.
Calling from Kotlin
Here's an example of calling this property from Kotlin code:
val format = Json { serializersModule = KotoolsTypesSerializers.zero }
val zero = Zero()
val encoded: String = format.encodeToString(zero)
assertEquals(expected = "0", actual = encoded)
val decoded: Zero = format.decodeFromString(encoded)
assertEquals(expected = zero, actual = decoded)
Content copied to clipboard