madsbf
02/17/2021, 9:24 AM@Serializable
sealed class Style {
@SerialName("default")
object Default : Style()
@SerialName("dark")
class Dark(...) : Style()
}
Now in order to future-proof the above in case new styles are introduced, we want to use the Default style in case a new type (“light” f.x.) is introduced.
Is there some idiomatic way to do this - besides using a custom serializer?Javier
02/17/2021, 10:00 AMedenman
02/19/2021, 1:49 AMedenman
02/19/2021, 1:49 AMobject Unknown : Style()
and then pass that into OneOfSerializer(Style.class, Style.Unknown)