Greetings, is there any way to make this `SearchRe...
# serialization
a
Greetings, is there any way to make this
SearchRequest
data class serialize itself with the superclass members? This is what I have so far: No errors are being thrown, just the members are missing
Copy code
Json {
    serializersModule = SerializersModule {
        polymorphic(RequestBase::class) {
            subclass(SearchRequest::class)
        }
    }
}

@Serializable
open class RequestBase(
    @SerialName("context")
    open val context: Context = Context()
)
@Serializable
data class SearchRequest(
    val query: String
) : RequestBase()
Fixed by adding
Copy code
encodeDefaults = true