I'm using Jackson
to deserialize a date into this attribute:
private Date createDate;
Part of a payload:
"createdDate": "1979-12-05T08:00Z",
Getting this error:
Can not deserialize value of type java.util.Date from String "1979-12-05T08:00Z": not a valid representation (error: Failed to parse Date value '1979-12-05T08:00Z': Can not parse date "1979-12-05T08:00.000Z": while it seems to fit format 'yyyy-MM-dd'T'HH:mm:ss.SSS'Z'', parsing fails
What I tried so far was to include this dependency:
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
and also:
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-ddTHH:mmZ")
private Date createDate;
but it didn't work.