Big Chungus
01/27/2020, 2:02 PM@file:UseSerializers(AnySerializer::class)
package lt.petuska.hazelcast.explorer.domain.environment.target.entity
import kotlinx.serialization.Serializable
import kotlinx.serialization.UseSerializers
import lt.petuska.hazelcast.explorer.serialization.AnySerializer
import lt.petuska.hazelcast.explorer.serialization.KClassSerializer
import kotlin.reflect.KClass
@Serializable
data class Topic(
val id: String,
val name: String,
val displayName: String,
val readOnly: Boolean,
@Serializable(with = KClassSerializer::class)
val valueType: KClass<*>
)
Results in empty object. Note that AnySerializer is also a custom resializer for Any type to get rid on compiler errors. It does nothing on serialization and returns and empty object on deserialization. It looks like this is overriding my KClassSerializer, however I could not figure out how to go around it. Any help/tips would be very welcome.