FasterXML / jackson-module-kotlin

Module that adds support for serialization/deserialization of Kotlin (http://kotlinlang.org) classes and data classes.
Apache License 2.0
1.12k stars 175 forks source link

Duration support #689

Closed kkurczewski closed 1 year ago

kkurczewski commented 1 year ago

Issue: https://github.com/FasterXML/jackson-module-kotlin/issues/683

Adds converter and deserializer which bridges conversions between kotlin.time.Duration and java.time.Duration.

In order to properly deserialize data class with duration following hacks are needed:

Notes:

k163377 commented 1 year ago

Sorry, but it seemed better to add a KotlinFeature as you originally suggested. It seems counter-intuitive to have an error message saying that the JavaTime module is required when processing Kotlin Duration.

cowtowncoder commented 1 year ago

CLA received.

kkurczewski commented 1 year ago

Rebased (other Kotlin feature added which cause conflict)

k163377 commented 1 year ago

As for the code, it is LGTM, thanks for the contribution!