引入依赖
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
添加启动
@EnableSwagger2
@Configuration
public class Swagger2Config {
}
访问地址
/v2/api-docs
/swagger-ui.html#/
SpringfoxSwagger2整合教程
本文介绍了如何在项目中引入SpringfoxSwagger2的依赖,通过添加@EnableSwagger2注解进行配置,以生成RESTfulAPI的文档。访问/v2/api-docs/swagger-ui.html#/可查看生成的文档。
8万+

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



