Scott Fedorov
07/03/2025, 11:00 PM{ "a": 1, "b":2 }
and want to start storing a new set of polydata, where it would end up serializing { "a": 1, "b":2, "c":2, "type": "com.example.WibbleV2" }
... the problem is the existing records would NOT have the type field for it to know it was V1.... trying to avoid the work of custom deserializers.Scott Fedorov
07/03/2025, 11:03 PM@Serializable
sealed class WibbeTypes {
@Serializable
data class WibbleV1(val a: Int, val b: Int): WibbleTypes
@Serializable
data class WibbleV2(val a: Int, val b: Int, val c: Int): WibbleTypes
}
New WibbleV1 records would serialize with the type, but getting old records out and deserializing would fail because the type field is missing.ephemient
07/04/2025, 12:59 AM