duncanconroy
07/01/2017, 2:14 PM{
"time" : "2017-06-29T16:00:00.000000Z",
"value" : : "foo"
}
And I'm trying to transform this using the libraries jackson-kotlin-module
and koda-time
.
My data class for this object looks like this:
data class MyObject<T>(val time: DateTime, val value: String)
I get an exception from jackson Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Can not construct instance of org.joda.time.DateTime (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('2017-06-01T00:00:00.000000Z')
It works, if I change the type from DateTime
to String
. I thought jackson could automatically map this, or am I mistaken?