I have an object containing both Date and LocalDate. I want to serialize it into string with the default Jackson "ObjectMapper" (not any module)
I use for both the following
@JsonProperty("id")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
Date myDate
@JsonProperty("id2")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
LocalDate myLocalDate
But it only work for the Date attribut, not the LocalDate. Any idea why?
I'm using java 13