Closed kkurczewski closed 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
.
CLA received.
Rebased (other Kotlin feature added which cause conflict)
As for the code, it is LGTM
, thanks for the contribution!
Issue: https://github.com/FasterXML/jackson-module-kotlin/issues/683
Adds converter and deserializer which bridges conversions between
kotlin.time.Duration
andjava.time.Duration
.In order to properly deserialize data class with duration following hacks are needed:
@JsonCreator
, primary ctor won't cut itNotes:
kotlin.time.Duration.toJavaDuration()
which can be used instead ISO parsing (in converter)java.time.Duration.toKotlinDuration()
which can be used instead ISO parsing (in deserializer)