dave08
02/26/2023, 4:26 PMdata class Foo(val name: String, val bl: Boolean = true)
val foo = Foo("bar", true)
// Becomes:
// { "name": "bar" } not { "name": "bar", "bl": true }?
Adam S
02/26/2023, 5:02 PMDefault values are not encoded by default in JSON. This behavior is motivated by the fact that in most real-life scenarios such configuration reduces visual clutter, and saves the amount of data being serialized.https://github.com/Kotlin/kotlinx.serialization/blob/v1.5.0/docs/basic-serialization.md#defaults-are-not-encoded-by-default
dave08
02/26/2023, 8:16 PM