Description
Describe the bug
Issue: The Swagger API specification generates incorrect request body examples when the RequestBody contains LocalTime, YearMonth, or MonthDay. The generated format does not comply with ISO 8601, displaying unexpected fields and values.
To Reproduce
version
java version : 17
springboot version : 3.4.3
Springdoc OpenAPI version : org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.5
lombok version : 1.18.36
TestController
@PostMapping("/time1")
public TimeDtoNoAnnotations postTime1(@RequestBody TimeDtoNoAnnotations timeDto) {
return timeDto;
}
@Builder
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class TimeDtoNoAnnotations {
LocalDateTime localDateTime;
LocalDate localDate;
LocalTime localTime;
YearMonth yearMonth;
MonthDay monthDay;
Year year;
}
Swagger default request body (incorrect behavior)
Swagger default example (Try it out result)
The value 1073741824 is 2³⁰, but its presence in the request body is unclear.
Expected output (correct ISO 8601 format)
Additional context
If this issue is still open and needs a fix, I would love to contribute. Please let me know if I can work on this.