I have a basic Body interface that I use for all my API requests ```@Serializable internal sealed in...
z
I have a basic Body interface that I use for all my API requests
Copy code
@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.
c
If it's an interface, it needs the
type
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
.