1

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

sab
  • 4,352
  • 7
  • 36
  • 60
  • 1
    I think this question has multiple answers: https://stackoverflow.com/q/28802544/2987755 – dkb Nov 17 '20 at 11:25

0 Answers0