Home

Published

- 1 min read

json parse error: cannot deserialize value of type `java.time.localdate` from string

img of json parse error: cannot deserialize value of type `java.time.localdate` from string

The solution for this is noted below

json parse error: cannot deserialize value of type java.time.localdate from string

Solution

   //There are milliseconds in the input string, so your format should be
//“yyyy-MM-dd’T’HH:mm:ss.SSS”
//Update: If the millisecond part consists of 1, 2, 3 digits or is optional,
//you may use the following format:


@JsonFormat(shape=JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss[.SSS][.SS][.S]")
private LocalDateTime updatedTime;

Try other methods by searching on the site. That is if this doesn’t work