I am encountering an issue with Swagger UI in my Spring Boot application where datetime values are displayed with milliseconds (2024-05-13T11:20:24.151Z) despite specifying a datetime format without milliseconds (yyyy-MM-dd’T’HH:mm:ss). This discrepancy is affecting the example values shown in Swagger documentation and the behavior of the “Try it out” feature.
Here is my setup for annotations:
@DateTimeFormat(pattern = )
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
@Schema(example = "2022-10-30T12:45:00", description = "Date time with UTC format")
private LocalDateTime dateTime;