问题1:新写的计划管理模块,打开swagger页面找不到
问题排查:
逐一与其他模块对照,发现是接口上注解记岔劈了,使用错误
将
@ApiOperation("xxxx") 写成了
@ApiImplicitParam("xxxx")
修改后恢复正常
正确使用;
类:
@Api(tags="xxxx")
接口:
@ApiOperation("xxxxx")
字段解释说明:
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "主键", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "pid", value = "父id", dataTypeClass = Integer.class)
)}
注:
dataTypeClass 不写会报警告-->Unable to interpret the implicit parameter configuration with dataType: , dataTypeClass: class java.lang.Void
问题2:点击接口查看字段内容时卡死
问题排查:
列表采用树结构,有一个字段是集合中包含实体类,字段注解中dataTypeClass=xxxx.class后写法错误,导致点击swagger时页面卡死
错误写法
@ApiImplicitParam(name = "weekPlanList", value = "周计划List<WeekPlan>",dataTypeClass = WeekPlan.class),
正确写法:
@ApiImplicitParam(name = "weekPlanList", value = "周计划List<WeekPlan>",dataTypeClass = List.class)