Rok Oblak
12/08/2024, 3:09 PMconsole.js:36 IllegalStateException: Sealed class 'nav.NavConfig.VehicleDetails' cannot be serialized as base class 'nav.NavConfig' because it has property name that conflicts with JSON class discriminator 'type'. You can either change class discriminator in JsonConfiguration, rename property with @SerialName annotation or fall back to array polymorphism
class:
@Serializable data class VehicleDetails(val vehicleId: Int?, val type: VehicleType?) : NavConfig(Paths.VEHICLE_DETAILS.withID(vehicleId))
renaming type
to vehicleType
fixes the issue
Kotlin 2.1.0
, kotlinx-serialization 1.7.3
Zyle Moore
12/08/2024, 4:51 PMVehicleDetails
on other targets with JSON? That error seems to indicate that it should fail on the JSON level, on other targets as well.Zyle Moore
12/08/2024, 4:54 PMRok Oblak
12/08/2024, 5:00 PM