swagger 2.9.0 2.9.2 2.9x Illegal DefaultValue null for parameter type integer 异常

该异常是由 swagger 引起的

解决方法:忽略原版本的swagger-annotations和swagger-models,添加1.5.21版本的

1 <dependency> 2 <groupId>io.springfox</groupId> 3 <artifactId>springfox-swagger-ui</artifactId> 4 <version>2.9.2</version> 5 <exclusions> 6 <exclusion> 7 <groupId>io.swagger</groupId> 8 <artifactId>swagger-annotations</artifactId> 9 </exclusion> 10 <exclusion> 11 <groupId>io.swagger</groupId> 12 <artifactId>swagger-models</artifactId> 13 </exclusion> 14 </exclusions> 15 </dependency> 16 <dependency> 17 <groupId>io.swagger</groupId> 18 <artifactId>swagger-annotations</artifactId> 19 <version>1.5.21</version> 20 </dependency> 21 <dependency> 22 <groupId>io.swagger</groupId> 23 <artifactId>swagger-models</artifactId> 24 <version>1.5.21</version> 25 </dependency>
点赞
收藏

评论区

加载中...

相关推荐

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

java配置SSM框架下的redis缓存

pom.xml引入依赖包<!jedis.jar<dependency<groupIdredis.clients</groupId<artifactIdjedis</artifactId<version2.9.0</version</depe

swagger

如果项目已经集成了swagger,只需要在pom.xml添加,如果你的项目没有集成swagger,自行百度或看最下方的链接swaggerbootstrapui是Swagger的前端UI实现,目的是替换Swagger默认的UI实现SwaggerUI,使文档更友好一点儿....swaggerbootstrapui 只是Swagger的UI实现,

Spring Boot demo系列(八):Swagger

2021.2.24更新1概述Swagger主要用于生成API文档,本文演示了如何使用目前最新的OpenAPI3以及Swagger来进行接口文档的生成。2依赖<dependency<groupIdorg.springdoc</groupId

Spring MVC 整合 Swagger

Swagger简要说明   将Swagger和SwaggerUI集成到系统中,可以实现接口可视化界面操作。版本号SwaggerUI2.2.10高于该版本,可能会出现“Nooperationsdefinedinspec”错误下载地址:https://github.c

IDEA Spring使用Swagger2 API接口

根据Swagger2可以快速帮助我们编写最新的API接口文档,再也不用担心开会前仍忙于整理各种资料了,间接提升了团队开发的沟通效率。1\.引入依赖<!Swagger2api接口插件<dependency<groupIdio.springfox</groupId