加载swagger报 java.lang.NumberFormatException: For input string: “”
问题
使用swagger2.9.2以后每次请求 swagger 的ui界面都会报java.lang.NumberFormatException: For input string: ""错,虽然无关大雅,但博主看着就是很不舒服
解决方案
在pom.xml中排除Springfox-Swagger的Swagger-Models的jar包,重新引入,如下:
<!-- 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>
这样就完美解决了访问ui界面报错的问题了