Hey, so I got simple class ```@Serializable data c...
# serialization
k
Hey, so I got simple class
Copy code
@Serializable data class RegisterResponse(val ok: Boolean = true)
which then is serialized into string. But I noticed that the serialization part is missing
ok: true
? I’m aware that by default setting, default values are not serialized - but in my case, doing
RegisterResponse(ok = true)
still gives an empty serialized string (
{}
). Passing
ok = false
works just fine
wait, is it that default values are not serializable, as in, even if I pass
ok = true
when instantiating this data class <- it will be omitted anyway?
m
At Runtime the serializer does not know that you created the object with an explicit value and not by using the default.
k
yeah, I just realized 💀coolio, thanks