-
Notifications
You must be signed in to change notification settings - Fork 1
07 springfox swagger2
Alan edited this page Apr 12, 2018
·
9 revisions

Spring Cloud程序快速接入SpringFox-swagger2
- pom.xml中添加依赖
<!-- swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-bean-validators</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.8.0</version>
</dependency>
-
和Application配置启动类同级添加Swagger配置类 参考代码
需要根据实际情况修改的代码:
.apis(RequestHandlerSelectors.basePackage("com.demo.controller"))// 扫描该包下的所有需要在Swagger中展示的API,@ApiIgnore注解标注的除外
3. 文档注解使用参考