解决springdoc-openapi-ui(Swagger3)跳转默认界面问题

文章目录

问题现象

项目正确引入springdoc-openapi-ui依赖,但是访问/swagger-ui/index.html界面时,跳转到了默认的界面,如下图所示:

解决方法

1、升级maven依赖为1.8.0以上:

xml 复制代码
<dependency>
	<groupId>org.springdoc</groupId>
	<artifactId>springdoc-openapi-ui</artifactId>
	<version>1.8.0</version>
</dependency>

2、增加springdoc的url配置:

yaml 复制代码
springdoc:
  swagger-ui:
    enabled: true # 开启swagger界面
    url: /cxhl/v3/api-docs # 自定义搜索路径
    #path: swagger-ui.html # 自定义路径,默认为"/swagger-ui/index.html"

修改后的界面,如下图所示:

项目中的接口文档都出来了,完美解决!

相关推荐
xcl09255 小时前
北京24小时自助健身房系统软件开发实战:从架构到部署全流程指南
java·spring boot·架构
一 乐7 小时前
动漫书销售商城|基于springboot + vue动漫书销售商城(源码+数据库+文档)
java·数据库·vue.js·spring boot·毕业设计
卓怡学长7 小时前
w214基于jsp知道特产网
java·intellij-idea
步行cgn7 小时前
Spring 注解使用详解
java·spring
一条小小yu8 小时前
Spring IoC的理解
java·后端·spring
落魄实习生8 小时前
Agent Scope Java 2.x 系列【7】工具使用
java·开发语言·ai
旺仔学长 哈哈8 小时前
springboot钓鱼爱好者交流平台APP设计与实现
java·spring boot·mysql·充电桩管理系统
Wx-bishekaifayuan9 小时前
django个性化旅游路线推荐平台49005-计算机课程设计、毕业设计
spring boot·后端·python·django·课程设计·express·旅游
自强的小白10 小时前
核心功能(Service接口)
java·mybatis