I have a class that represent data in which there is LocalDate
field.
public class Student {
private String name;
private LocalDate dob;
//getters and setters
}
In pom.xml
I have jackson-modules-java8
so that Local
Date could be deserialized. I'm having difficulty preparing correct JSON to be able to send POST
. Here it is:
{ "name" : "John", "dob" : [ 1986::10::06 ] }
In a response to POST
I get Cannot deserialize instance of
java.time.LocalDateout of START_ARRAY token
. Decorating the field dob with annotation @JsonFormat(pattern = "yyyy::MM::dd")
didnn't work. Three years ago workaround was published but things may have changed since then.