Kantis / ks3

KotlinX Serialization Standard Serializers (KS3)
Apache License 2.0
19 stars 4 forks source link

Serializers for java.time.* #6

Open aSemy opened 1 year ago

aSemy commented 1 year ago

https://github.com/Kotlin/kotlinx.serialization/issues/1806

What is your use-case and why do you need this feature?

We use a lot of java.time.OffsetDateTime which it is a bit cumbersome to have to annotate separately with a custom serializer like @Serializable(KOffsetDateTimeSerializer::class).

Describe the solution you'd like

It would be useful to have a special org.jetbrains.kotlinx:kotlinx-serialization-jvmtime dependency which automatically adds serializers to handle some very common classes from the java8 java.time module.

Kantis commented 1 year ago

I think it makes sense to start out with:

This means excluding these types for now:

Based on the assumption that these are less commonly used, especially in serial forms.

I think it's top priority to get support for: