Swagger快速理解
Swagger:The Best APIs are Built with Swagger Tools
。Swagger可以定义一个标准的RESTful风格的API,与语言无关,是一个API的规范。
Swagger官网:http://swagger.io
GitHub地址:https://github.com/swagger-api
这里,提到Swagger就不得不说说Springfox,Springfox是一个开源的API Doc的框架, 它的前身是swagger-springmvc,可以将我们的Controller中的方法以文档的形式展现。官方定义为: Automated JSON API documentation for API’s built with Spring。Swagger和SpringFox到底什么关系呢?
- Swagger Spec 是一个规范。
- Swagger Api 是 Swagger Spec 规范 的一个实现,它支持 jax-rs, restlet, jersey 等等。
- Springfox libraries 是 Swagger Spec 规范 的另一个实现,专注于 spring 生态系统。
- Swagger.js and Swagger-ui 是 javascript 的客户端库,能消费该规范。
- springfox-swagger-ui 仅仅是以一种方便的方式封装了 swagge