0

I recently upgraded my service from springboot 2.7 to 3.0. My controller argument is as such:

@RequestParam("from") @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssZ") Date startTime, @RequestParam("to") @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssZ") Date endTime

However, I receive a 400 error for my requests after the upgrade:

{"type":"about:blank","title":"Bad Request","status":400,"detail":"Failed to convert 'null' with value: '2000-01-01T00:00:00Z'","instance":"/users"}

The conversion of the date from string to Date fails. Previously, this was not the case in springboot 2.7. I do not see any changes with regards to date in springboot 3 release notes.

What could be the reason for this error?

fxxixx
  • 116
  • 1
  • 10

0 Answers0