问题 swagger2 版本: 2.9.2
报错信息:java.lang.NumberFormatException: For input string: “”
原因是 swagger-models-1.5.20.jar有bug
解决方法:1.等待升级解决问题
2.排除这个jar,引用回旧版没问题的jar
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
本文详细介绍了在使用Swagger 2.9.2版本时遇到的java.lang.NumberFormatException错误,并提供了具体的解决方案,包括排除问题jar包及引用稳定版本。
257

被折叠的 条评论
为什么被折叠?



