Swagger3.0(Springdoc)日常使用记录

文章目录


前言

本文并不是Swagger的使用教程,只是记录一下本人的操作,感兴趣的可以看下

一、默认地址

http://localhost:9083/lims/swagger-ui/index.html

http://server:port/context-path/v3/api-docs

http://server:port/context-path/v3/api-docs.yaml

二、注解

@Operation

@Operation(summary = "删除仪器备份管理表", description = "删除仪器备份管理表")

summary代表上面的信息

description是接口的详细信息

@Tag

@Tag(name = "hello",description = "hello2")

@Tag注解在文档中起着美化和分类的作用,但和API的运行逻辑及其功能没有直接的关系。

@Tag里面还有一个 extensions属性,可以用来挂文档,就是代码解释什么的

三、SpringBoot基础配置

Springdoc入门地址

yaml 复制代码
springdoc:
  api-docs:
    # 是否开启接口文档
    enabled: true
  swagger-ui:
    # 持久化认证数据,如果设置为 true,它会保留授权数据并且不会在浏览器关闭/刷新时丢失
    persistAuthorization: true
    path: /swagger-ui.html
xml 复制代码
    <dependency>
                <groupId>org.springdoc</groupId>
                <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
                <version>${swagger.version}</version>
            </dependency>

四、Swagger导入apifox

官网教程

  • 进入项目
  • 选择导入数据
  • 填写Swagger地址
  • 有的Swagger配置了密码
  • 上面有定时导入

五、Swagger其他配置

  • Disabling the /v3/api-docs endpoint
    springdoc.api-docs.enabled=false
  • Disabling the swagger-ui
    springdoc.swagger-ui.enabled=false

六 knife4j

参考文章

个人笔记,不同意见,望有交流

直接可以点击跳转连接

作者

Springdoc
官网https://swagger.io/

相关推荐
召田最帅boy8 天前
Swagger使用教程
swagger
闲人编程13 天前
OpenAPI/Swagger规范与API文档自动化
运维·自动化·json·swagger·schema·openapi·codecapsule
一念一花一世界13 天前
接口管理工具选型:Swagger与PostIn全面对比指南
测试工具·postman·swagger·postin·接口管理工具
一念一花一世界14 天前
接口管理工具选型:Postman、Swagger与PostIn的全面对比指南
测试工具·postman·swagger·接口管理工具
西部森林牧歌1 个月前
Postman、swagger、PostIn接口管理工具详细纵评
postman·swagger·postin·接口管理工具
西部森林牧歌1 个月前
接口管理工具选型指南:swagger与PostIn深度对比
swagger·postin·tiklab devops·接口管理工具
wangmengxxw1 个月前
Swagger技术
java·swagger
猿与禅1 个月前
SpringBoot 2.x 升级到 3.x 时 Swagger 迁移完整指南
swagger·springboot升级·springboot3.0·swagger3.0
東雪木1 个月前
Spring Boot 2.x 集成 Knife4j (OpenAPI 3) 完整操作指南
java·spring boot·后端·swagger·knife4j·java异常处理
一念一花一世界1 个月前
swagger和PostIn,开源免费接口管理工具选型指南
api·swagger·postin·接口管理工具