Swagger使用之Swagger UI和Swagger Springfox
Swagger UI
-
一款RESTFUL接口文档的在线生成工具
-
一款RESTFUL接口的在线测试工具
-
便于最终开发人员轻松地进行各类交互
Swagger Springfox
- Springfox由swagger-springmvc发展而来
- Springfox负责扫描代码提取信息生成API文档
- Springfox通过Swagger-UI呈现API文档
需要在代码中引入如下依赖
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 --><dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger2</artifactId><version>2.7.0</version></dependency><!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui --><dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger-ui</artifactId><version>2.7.0</version></dependency>