1、pom文件引入
<properties>
<springfox-swagger2-version>2.9.2</springfox-swagger2-version>
</properties>
<!-- swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox-swagger2-version}</version>
</dependency>
2、启动类上加注解 @EnableSwagger2
本文档介绍了如何在Spring Boot项目中引入Springfox Swagger2来创建RESTful API的交互式文档。首先,在pom.xml文件中添加依赖,设置springfox-swagger2的版本号。然后,在启动类上添加@EnableSwagger2注解,启动Swagger2的功能。通过这些步骤,你可以轻松地为你的API生成详细的文档。
2981

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



