solianlg / lumen-yaml-swagger
使用yaml格式文档生成swagger接口文档
1.0.0
2019-04-10 15:19 UTC
Requires
- php: >=7.1.3
- darkaonline/swagger-lume: ^5.6
- laravel/lumen-framework: ^5.6
- symfony/yaml: ^4.1
- vlucas/phpdotenv: ^3.3
Requires (Dev)
- fzaninotto/faker: ~1.4
- mockery/mockery: ~1.0
- phpunit/phpunit: ~7.0
- satooshi/php-coveralls: ^2.0
This package is auto-updated.
Last update: 2024-09-29 05:28:31 UTC
README
为Lumen 5提供的Swagger 2.0
对 SwaggerLume 进行封装。使其支持YAML文档。
安装
composer require --dev soliangd/lumen-yaml-swagger
bootstrap/app.php
- 去掉门面注释
$app->withFacades();
- 复制配置并加载
$app->configure('yaml-swagger');
- 注册服务
$app->register(\Soocoo\Swagger\SwaggerLumenServiceProvider::class);
- 配置YAML目录
config/yaml-swagger.php
:[ "paths" => [ "yaml_annotations" => [base_path('docs')] // 默认目录 ] ]
- 路由重定向
注意nginx配置时将 swagger路由重定向 swagger文档支持 location ~ /(swagger-ui-assets) { index index.php; try_files $uri $uri/ /index.php?$query_string; } ````php