YunhanPHP / lumen-dev-yaml-swagger by raygu0101

Swagger文档,用PHP注释可读性差,维护性差,使用YAML格式
13
0
2
Package Data
Maintainer Username: raygu0101
Maintainer Contact: raygu0101@gmail.com (RayGu)
Package Create Date: 2018-06-23
Package Last Update: 2018-08-30
Language: PHP
License: MIT
Last Refreshed: 2024-11-15 15:11:07
Package Statistics
Total Downloads: 13
Monthly Downloads: 4
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 1
Total Open Issues: 0

SwaggerLumenYaml

Swagger 2.0 for Lumen 5

SwaggerLume 进行封装。 使其支持YAML文档。

安装

composer require --dev yunhanphp/lumen-dev-yaml-swagger

bootstrap/app.php

  • 去掉门面注释:
         $app->withFacades();
    
  • 添加配置加载:
         $app->configure('swagger-lume');
    
  • 注册服务:
        $app->register(\YunhanDev\Swagger\SwaggerLumenServiceProvider::class);
    
  • 配置YAML目录 config/swagger-lume.php
    [
        "paths" => [
            "yamlAnnotations" => [base_path('docs')] // 默认目录
        ]
    ]
    

其它使用见 SwaggerLume 文档