JAVA-5934Backlog

Add contextual serializer for kotlin.date.Instant

The MongoDB Kotlin driver supports contextual serializers for the kotlinx.datetime library using the @Contextual annotation from kotlinx-serialization. Since Kotlin version 2.1 these types have moved from kotlinx-datetime to the Kotlin stdlib and are thus deprecated. It would be nice to have @Contextual support for the new stdlib classes such as kotlin.date.Instant out of the box. Workaround in the meantime: Create your custom serializer.

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix

No fix available yet.

Components
Server components related to this issue
Kotlin
Labels
Tags and classification
kotlin