Swagger无法渲染 Finished Loading Resource Information. Rendering Swagger UI...

问题:无法渲染swagger ui页面,本来swagger页面是正常加载的,但突然不能加载了

 

 修改前代码:

 @ApiOperation(value = "新地图的告警", notes = "新地图的告警")
    @GetMapping("/getAlarmList")
    @MyLog(title = "地图配置管理-查询",action = "新地图的告警")
    public DataResult getListByECIds( Boolean dataRights, HttpServletRequest request, String type) {
        String accessToken=request.getHeader(BaseConstant.ACCESS_TOKEN);
        String userId = JwtTokenUtil.getUserId(accessToken);
        List<Map> list = null;
        try {
            list =  gisEntityGeometryService.getAlarmList(userId,dataRights,type);
        } catch (Exception e) {
            e.printStackTrace();
            return DataResult.getResult(400, "查询失败");
        }
        return DataResult.success(list);
    }

修改代码后:

 @ApiOperation(value = "新地图的告警", notes = "新地图的告警")
    @GetMapping("/getAlarmList")
    @MyLog(title = "地图配置管理-查询",action = "新地图的告警")
    public DataResult getListByECIds(@RequestParam("dataRights") Boolean dataRights, HttpServletRequest request, String type) {
        String accessToken=request.getHeader(BaseConstant.ACCESS_TOKEN);
        String userId = JwtTokenUtil.getUserId(accessToken);
        List<Map> list = null;
        try {
            list =  gisEntityGeometryService.getAlarmList(userId,dataRights,type);
        } catch (Exception e) {
            e.printStackTrace();
            return DataResult.getResult(400, "查询失败");
        }
        return DataResult.success(list);
    }

原因:该接口有个boolean参数没有添加@RequestParam注解,随后加上该注解,swagger又可以加载了

posted @ 2021-11-20 15:49  wq9  阅读(167)  评论(0编辑  收藏  举报