Hi guys, I'm seeking for some help with a stupid p...
# jackson-kotlin
d
Hi guys, I'm seeking for some help with a stupid problem. I have some JSON data like this:
Copy code
{
		"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:
Copy code
data class MyObject<T>(val time: DateTime, val value: String)
I get an exception from jackson
Copy code
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?