zt
03/05/2023, 5:34 AM@Serializable
internal sealed interface Body {
val context: ApiContext
}
The problem is that when serializing, it also adds the type field assuming its using polymorphism but I don't want it to do that.CLOVIS
03/06/2023, 3:53 PMtype
discriminator—otherwise, how would it know which implementation of the interface to use?
If you serialize and deserialize concrete subclasses of Body
, it will not add the type
.