I have an angular app which send me a date like this dd/MM/yyyy and like this yyyy-MM-dd. How can i use @JsonFormat to accept two kind of pattern? Currently i just use:
@Temporal(TemporalType.DATE)
@JsonFormat(pattern="dd/MM/yyyy")
private Date hireDate;
it's work when the date that i receive is in this format dd/MM/yyyyy but when the date is in this format yyyy-MM-dd i have a json parse error
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type `java.util.Date` from String "2018-10-26": expected format "dd/MM/yyyy";