Can I not have a base interface without it adding a
type
field? I do not want polymorphism here as the type is determined by the structure. Is there some way around this?
Copy code
@Serializable
interface Base {
val a: Int
}
// should serialize to { "a": 10, "b": 10 }
@Serializable
data class A(override val a: Int, val b: Int) : Base
// should serialize to { "a": 10, "c": 10 }
@Serializable
data class B(override val a: Int, val c: Int) : Base