spring boot2 集成Shiro + Swagger2.x,Swagger页面无法查看接口

1、踩坑一:

Shiro + Swagger2.x,Swagger页面无法查看接口

解决办法:

///swagger2接口权限 开放
filterMap.put("/swagger-ui.html","anon");
filterMap.put("/static/**", "anon");
filterMap.put("/swagger/**","anon");
filterMap.put("/webjars/**", "anon");
filterMap.put("/swagger-resources/**","anon");
filterMap.put("/v2/**","anon");

注意:一定要注意 上面 这个 我打红色的地方,这个不加,swagger界面会出来,但是看不到里面,不会生效!!!

1、踩坑二:

swagger的一个bug

使用实体类中,Long、 Integer类型的属性加@ApiModelProperty时,必须要给example参数赋值,且值必须为数字类型。

要不然会报错:异常AbstractSerializableParameter

比如:

猜你喜欢

转载自blog.csdn.net/CHL123456789/article/details/100889690