tseisel
05/27/2021, 6:35 PMEntity
: one with all properties, and another SimpleEntity
with only the most used properties from Entity
. How can I do that? I thought of using closed polymorphism but I can't use a discriminator because I don't control the input JSON.diesieben07
05/27/2021, 6:37 PMtseisel
05/27/2021, 7:12 PMopen class SimpleEntity(val foo: String, ...)
• class Entity(foo: String, val bar: Int) : SimpleEntity(foo)
and the dedicated implementation of JsonContentPolymorphicSerializer
?diesieben07
05/27/2021, 7:17 PMtseisel
05/27/2021, 7:19 PMtseisel
05/28/2021, 12:18 PM@Serializable class
extend from a @Serializable open class
; I ended up using a sealed class
as base.