SpringDoc(swagger)在线文档通常用于开发阶段使用,默认情况下SpringDoc(swagger)在线文档处于关闭状态。
开启方法
修改配置文件:src/main/resources/application.yaml(开发环境)或WEB-INF/classes/application.yaml(部署环境)
将springdoc.api-docs.enabled和springdoc.swagger-ui.enabled设置为true。注意必须两项都设置,否则无效。
# 默认关闭 SpringDoc
# 文档JSON地址:/v3/api-docs
springdoc.api-docs.enabled: true
# 文档HTML地址:/swagger-ui/index.html
springdoc.swagger-ui.enabled: true修改完成后重复Tomcat服务,即可生效。
访问地址
/swagger-ui/index.html
如http://localhost:8080/swagger-ui/index.html或https://demo.ujcms.com/swagger-ui/index.html

