本篇讲述在如何快速在Laravel中引入Swagger并开始使用。
安装
首先是使用Laravel的一个composer:L5 Swagger
。
下面是对应的各个版本。
Laravel | Swagger UI | OpenAPI Spec compatibility | L5-Swagger |
---|---|---|---|
5.1.x | 2.2 | 1.1, 1.2, 2.0 | php composer require “darkaonline/l5-swagger:~3.0” |
5.2.x | 2.2 | 1.1, 1.2, 2.0 | php composer require “darkaonline/l5-swagger:~3.0” |
5.3.x | 2.2 | 1.1, 1.2, 2.0 | php composer require “darkaonline/l5-swagger:~3.0” |
5.4.x | 2.2 | 1.1, 1.2, 2.0 | php composer require “darkaonline/l5-swagger:~3.0” |
5.4.x | 3 | 2.0 | php composer require “darkaonline/l5-swagger:5.4.*” |
5.5.x | 3 | 2.0 | php composer require “darkaonline/l5-swagger:5.5.*” |
下面的过程全部基于Laravel 5.5.x</