Using spring I have this endpoint,
@RequestMapping(value = "/time/{date}", method = RequestMethod.GET)
public ModelRunCollection getPolicyByDate(GetPolicyByDateRequest request) {
return delegate.submit(request);
}
With the request object looking like this
@Getter
@Setter
public class GetPolicyByDateRequest {
@DateTimeFormat(pattern = "YYYY-MM-DDTHH:mm:ss.sssZ")
private DateTime date;
public GetPolicyByDateRequest date(DateTime date) {
this.date = date;
return this;
}
}
The url I am hitting is this
http://localhost:8080/time/2020-01-17T00:33:53.148Z
And the error I get is
Validation failed for object='getCreditPolicyByDateRequest'. Error count: 1
I haven't been able to understand why this is a problem. I looked at this solution, but seem to be doing the exact thing he mentions