这两天在做接口管理的时候研究了下Swagger2,Swagger2让接口的管理更加方便!Api接口文档生成工具Swagger2,图形化界面目前发现了四款,做一下总结,方便自己日后学习和使用!
目录
1.原始的UI界面
1.1 pom.xml引入jar包
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
1.2 访问路径和界面
http://localhost:8080/swagger-ui.html
2.优化UI界面1
2.1 pom.xml引入jar包
<!-- 引入swagger-bootstrap-ui包 /doc.html-->
<!--http://localhost:8080/doc.html-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>1.9.6</version>
</dependency>
2.2 访问路径和界面
http://localhost:8080/doc.html
3.优化UI界面2
3.1 pom.xml引入jar包
<!-- 引入swagger-ui-layer包 /document.html-->
<!--http://localhost:8080/document.html -->
<dependency>
<groupId>com.zyplayer</groupId>
<artifactId>swagger-mg-ui</artifactId>
<version>1.0.6</version>
</dependency>
3.2 访问路径和界面
http://localhost:8080/document.html
4.优化UI界面3
4.1 pom.xml引入jar包
<!-- 引入swagger-ui-layer包 /docs.html-->
<!-- http://localhost:8080/docs.html-->
<dependency>
<groupId>com.github.caspar-chen</groupId>
<artifactId>swagger-ui-layer</artifactId>
<version>1.1.3</version>
</dependency>