The problem here is kotlinx.serialization doesn’t know BSON types. So, you need to transform these types to JSON types. This is my Custom serializer for ObjectId, as you wish.
The problem here is kotlinx.serialization doesn’t know BSON types. So, you need to transform these types to JSON types. This is my Custom serializer for ObjectId, as you wish.