I have a serializable data class that I am using with ktor client
@Serializable
data class Job (
val information: JobInformation = JobInformation(),
val additional: AdditionalInformation = AdditionalInformation(),
val bom: PersistentList<BOM> = persistentListOf()
)
@Serializable
data class BOM(
@SerialName("comp_item")
val compItem: String = "",
val sequence: String = "",
@SerialName("comp_qty")
val compQty: String = "",
@SerialName("comp_uom")
val compUom: String = "",
val operation: String = "",
val type: String = ""
)
but when ktor client tries to decode the data from the request response I get this error
kotlinx.serialization.json.internal.JsonDecodingException: Expected class kotlinx.serialization.json.JsonObject (Kotlin reflection is not available) as the serialized body of kotlinx.serialization.Polymorphic<PersistentList>, but had class kotlinx.serialization.json.JsonArray (Kotlin reflection is not available)
I understand what the error is saying but I don't know how to fix it.