I have Ticket class:
data class Ticket(
var contact_email : String? = null,
var date_opened : LocalDateTime? = null
)
but I get error during read from string:
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of
java.time.LocalDateTime
(no Creators, like default construct, exist): no String-argument constructor/factory method to deserialize from String value ('2017-11-13T06:40:00Z') at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: rnd_classifier.model.Ticket["date_opened"])
I tried add annotations without success:
data class Ticket(
var contact_email : String? = null,
@JsonSerialize(using = ToStringSerializer::class)
@JsonDeserialize(using = LocalDateTimeDeserializer::class)
var date_opened : LocalDateTime? = null
)
How to fixed it?