解决swagger2.9,2 注释只能显示tags,其它显示不了的问题

解决swagger2.9,2 注释只能显示tags,其它显示不了的问题_第1张图片

将文档类型改成如下

解决swagger2.9,2 注释只能显示tags,其它显示不了的问题_第2张图片

 

swagger2.9.2会出现NumberFormatException

解决办法如下:

删除旧的swagger版本(1.5.20)并添加新的。

在pom.xml中

< 依赖 >
	< groupId > io.springfox groupId >
	< artifactId > springfox-swagger2 artifactId >
	< version > 2.9.2 version >
	< exclusions >
		< 排除 >
			< groupId > io.swagger groupId >
			< artifactId > swagger-annotations artifactId >
		exclusion >
		< 排除 >
			< groupId > io.swagger groupId >
			< artifactId > swagger-models artifactId >
		exclusion >
	exclusions >
dependency >
< 依赖 >
	< groupId > io.springfox groupId >
	< artifactId > springfox-swagger-ui artifactId >
	< version > 2.9.2 version >
dependency >
< 依赖 >
	< groupId > io.swagger groupId >
	< artifactId > swagger-annotations artifactId >
	< version > 1.5.21 version >
dependency >
< 依赖 >
	< groupId > io.swagger groupId >
	< artifactId > swagger-models artifactId >
	< version > 1.5.21 version >
dependency >

若是gradle

compile("io.springfox:springfox-swagger2:$swaggerVersion") {
   exclude group: 'io.swagger', module: 'swagger-annotations'
   exclude group: 'io.swagger', module: 'swagger-models'
}
compile("io.springfox:springfox-swagger-ui:$swaggerVersion")
compile("io.swagger:swagger-annotations:1.5.21")
compile("io.swagger:swagger-models:1.5.21")

 

你可能感兴趣的:(解决swagger2.9,2 注释只能显示tags,其它显示不了的问题)