79188870

Date: 2024-11-14 13:10:49
Score: 1.5
Natty:
Report link

It is solution also when using @JsonFormat to parse date:

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd.MM.yyyy HH:mm:ss") private Date scheduledTime;

when default constructor is not provided then default parser for date is used and default patterns (but are provided @AllArgsConstructor and getters/setters). What is interesting it works during serialization, but not during deserialization. If you want to avoid manual ObjectMapper configuration then provide default constructor for the class, I suppose that @Andreas answer is coupled also with this issue.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • User mentioned (1): @JsonFormat
  • User mentioned (0): @AllArgsConstructor
  • User mentioned (0): @Andreas
  • Low reputation (0.5):
Posted by: Damian JK