xxfast
09/18/2022, 4:40 AMkotlinx.serialization.json.internal.JsonEncodingException: Value of type 'kotlinx.serialization.Polymorphic<IdType>' can't be used in JSON as a key in the map. It should have either primitive or enum kind, but its kind is 'OPEN'.
where
interface IdType : Parcelable {
val name: String
}
enum class PersonIdType : IdType {
GIVEN_NAME, MIDDLE_NAMES, FAMILY_NAME
}
enum class VehicleIdType : IdType {
PLATE_NUMBER, VIN, ENGINE_NUMBER,
}
is this a known limitation? 🤔Dominaezzz
09/18/2022, 1:34 PMIdType
the result is going to be an object and not a string. JSON doesn't allow object keys.Dominaezzz
09/18/2022, 1:35 PMIdType
to achieve what you want.xxfast
09/20/2022, 9:02 AM