manlan
10/16/2020, 5:58 PMorg.litote.kmongo:kmongo-coroutine-serialization:4.1.3
in Ktor.
How would I serialize the ObjectId class to the String type in my class.kotlinx.serialization.SerializationException: Class 'WrappedObjectId' is not registered for polymorphic serialization in the scope of 'Id'.
Mark the base class as 'sealed' or register the serializer explicitly.
This is what I get 😞
My model class:val jsonConfig = Json { serializersModule = IdKotlinXSerializationModule }
install(ContentNegotiation) { json(jsonConfig) }
implementation("org.litote.kmongo:kmongo-id-serialization:4.1.3")
_id
field is still returned as _id
instead of id
even while using the @SerialName("_id")
annotation 😫Point
class for geo-spatial queries?
readString can only be called when CurrentBSONType is STRING, not when CurrentBSONType is DOCUMENT.
I get this error when I use this custom serializer: