SpringBoot关于Swagger启动报错

时间:2025-03-17 08:14:18

目录

  • 记录SpringBoot关于Swagger启动报错

记录SpringBoot关于Swagger启动报错

某个SpringBoot项目启动报如下错误

: null
	at (:131)
	at (:59)
	at (:132)
	at (:648)
	at (:612)
	at (:220)
	at $(:169)
	at $3$(:193)
	at $2$(:175)
	at $3$(:193)
	at $(:1382)
	at (:482)
	at (:472)
	at $(:708)
	at (:234)
	at (:499)
	at (:93)
	at (:144)
	at (:72)
	at $new$0(:43)
	at (:1127)
	at (:48)
	at (:72)
	at (:169)
	at (:67)
	at (:96)
	at (:82)
	at (:100)
	at (:182)
	at $200(:53)
	at $(:360)
	at (:158)
	at (:122)
	at (:895)
	at (:554)
	at (:143)
	at (:758)
	at (:750)
	at (:405)
	at (:315)
	at (:1237)
	at (:1226)
	at (:20)

原因是整合Swagger之后,Controller层某个接口接收了两个实体类,类的名称一样导致的,栗子:某个Controller中

@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
public R getPmFcPerformanceBondPage(PageDto page, PmFcPerformanceBond pmFcPerformanceBond, PmFcBidBond pmFcBidBond) {
   QueryWrapper<PmFcPerformanceBond> query = (pmFcPerformanceBond, page);
   return (((Page) page, query));
}

类PmFcPerformanceBond和PmFcBidBond两个中有相同的参数导致的。