putianxin / lumen-yaml-swagger by putianxin

Swagger文档,用PHP注释可读性差,维护性差,使用YAML格式
7
2
3
Package Data
Maintainer Username: putianxin
Maintainer Contact: putianxin@vip.qq.com (ptx)
Package Create Date: 2018-08-21
Package Last Update: 2020-10-03
Language: PHP
License: MIT
Last Refreshed: 2024-11-23 03:11:36
Package Statistics
Total Downloads: 7
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 2
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

SwaggerLumenYaml

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"
       *   )
       * )
       */
    

其它使用见 SwaggerLume 文档