ruoyi-vue-plus swagger页面404
ruoyi-vue-plus swagger页面打不开
ruoyi-vue-plus swagger页面升级Knife
ruoyi-vue-plus所用版本 4.X
1.根据说明文档 说明文档(跳转) UI界面已被移除

2.原因
项目所依赖的springdoc为:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webmvc-core</artifactId>
</dependency>
3.问题处理
而我们想要swagger界面则要替换成:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.14</version>
</dependency>
4.剖析
springdoc-openapi-ui 里面依赖了springdoc-openapi-webmvc-core,而ruoyi-vue-plus直接依赖的是springdoc-openapi-webmvc-core,所以springdoc-openapi-ui 里集成的swagger-ui 没了 自然也就没了swagger页面

5.升级knife4j UI界面展示
加入knife4j-springdoc-ui 依赖即可
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-springdoc-ui</artifactId>
<version>3.0.3</version>
</dependency>
6.访问路径
http://localhost:8080/swagger-ui.html
http://localhost:8080/swagger-ui/index.html
http://localhost:8080/doc.html
文章讲述了在ruoyi-vue-plusswagger项目中,由于依赖关系变化导致Swagger页面失效的问题。作者提供了从springdoc-openapi-webmvc-core升级到springdoc-openapi-ui和引入knife4j-springdoc-ui以实现SwaggerUI界面的解决方案。
1万+

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



