ptx / lumen-yaml-swagger
Swagger文档,用PHP注释可读性差,维护性差,使用YAML格式
v1.0.2
2018-10-16 10:19 UTC
Requires
- php: >=7.1.3
- darkaonline/swagger-lume: ^5.5
- laravel/lumen-framework: ^5.5
- symfony/yaml: ^4.1
- zircote/swagger-php: ~2.0
Requires (Dev)
- fzaninotto/faker: ~1.4
- mockery/mockery: ~1.0
- phpunit/phpunit: 7.0.*
- satooshi/php-coveralls: ^2.0
This package is not auto-updated.
Last update: 2024-11-10 06:33:33 UTC
README
Swagger 2.0 for Lumen 5
对 SwaggerLume 进行封装。 使其支持YAML文档。
安装
composer require --dev ptx/lumenyaml-swagger
bootstrap/app.php
- 去掉门面注释:
$app->withFacades();
- 添加配置加载:
$app->configure('swagger-lume');
- 注册服务:
$app->register(\PtxDev\Swagger\SwaggerLumenServiceProvider::class);
app/Providers/AppServiceProviders.php
- 添加默认@SWG/Info
/** * @SWG\Swagger( * @SWG\Info( * title="My first swagger documented API", * version="1.0.0" * ) * ) */