Swagger异常:java.lang.NumberFormatException: For input string: ""

问题

项目整合Swagger,访问Swagger首页时后台抛出下面异常:

i.s.m.p.AbstractSerializableParameter : Illegal DefaultValue null for parameter type integer
java.lang.NumberFormatException: For input string: “”

原因好像是说swagger2本身引用的swagger-models-1.5.20.jarbug

解决

导入下面的maven坐标:

<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>

<dependency>
	<groupId>io.swagger</groupId>
	<artifactId>swagger-models</artifactId>
	<version>1.5.21</version>
</dependency>
posted @ 2019-03-25 14:36  tiancixiong  阅读(15)  评论(0)    收藏  举报