For java.util.Date when I do
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = \"dd/MM/yyyy\") private Date dateOfBirth; <
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = \"dd/MM/yyyy\") private Date dateOfBirth;
ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new JavaTimeModule()); mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
works fine for me.