前后端分离项目 用的是swagger给前端大爷测试 觉得不好用换了皮肤 knife4j 刀
刚启动项目没问题,只要刷新swagger就会一直报这个错误java.lang.NumberFormatException: For input string: “”
控制台一直在哪里噼里啪啦的这谁能忍!不影响使用但是真的是:
一直报这个错误,我看了一篇博客
我发现跟着他走了一遍debug发现并没有解决问题,因为我的debug的description属性在controller的@ApiImplicitParam注解上。于是我注释掉这个注解,重新debug启动,刷新,还是没点屁用。
后来我把pom文件的swagger 依赖 dependency换了别的
我的springboot版本2.2.4
<!-- <dependency>-->
<!-- <groupId>io.springfox</groupId>-->
<!-- <artifactId>springfox-swagger2</artifactId>-->
<!-- <version>2.9.2</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.springfox</groupId>-->
<!-- <artifactId>springfox-swagger-ui</artifactId>-->
<!-- <version>2.9.2</version>-->
<!-- </dependency>-->
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/io.swagger/swagger-models -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
上面的是我注掉的,后面的是我复制上去的 具体原因可以好像是版本问题,也就是swagger的bug,之前我看到一篇博客debug找到错误改源码也可以解决。