原文地址

https://blog.csdn.net/weixin_44203158/article/details/109137799

 

swagger介绍

Swagger 是一套基于 OpenAPI 规范(OpenAPI Specification,OAS)构建的开源工具,后来成为了 Open API 标准的主要定义者。
对于 Rest API 来说很重要的一部分内容就是文档,Swagger 为我们提供了一套通过代码和注解自动生成文档的方法,这一点对于保证API 文档的及时性将有很大的帮助。

swagger2于17年停止维护,现在最新的版本为17年发布的 Swagger3(Open Api3)。

 

 

注意:

Maven项目中引入springfox-boot-starter依赖:

<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-boot-starter</artifactId>
    <version>3.0.0</version>
</dependency>

 

使用@EnableOpenApi注解Controller类,启用swagger配置

@EnableOpenApi
@Configuration
public class SwaggerController {

}

 

 

Swagger 3.0使用教程(转载)

 

相关文章:

  • 2021-07-30
  • 2021-06-28
  • 2022-02-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2020-07-14
猜你喜欢
  • 2022-12-23
  • 2018-06-15
  • 2019-10-18
  • 2021-10-21
  • 2021-08-24
  • 2021-08-04
  • 2022-02-24
相关资源
相似解决方案