swagger Failed to convert value of type ‘java.lang.String’ to required type ‘java.time.LocalDate

使用@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)

public HttpResponse scaleResource(@RequestParam(name = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) @ApiParam(value = "开始时间", format = "yyyy-MM-dd", example = "2024-01-01") LocalDate startDate,
                                      @RequestParam(name = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) @ApiParam(value = "结束时间", format = "yyyy-MM-dd", example = "2024-01-01") LocalDate endDate,
                                      @RequestParam(name = "pageSize") @Validated @ApiParam(value = "每页数", required = true) Long pageSize,
                                      @RequestParam(name = "pageNum")  @Validated @ApiParam(value = "页数", required = true) Long pageNum,
                                      @RequestParam(name = "createdBy", required = false) @ApiParam(value = "操作人") String createdBy,
                                      @RequestParam(name = "resourceType", required = false) @ApiParam(value = "资源类型") String resourceType) {
}

你可能感兴趣的:(java,windows,开发语言)