yunhanphp/lumen-dev-yaml-swagger

Swagger文档,用PHP注释可读性差,维护性差,使用YAML格式

v1.0.3 2018-08-30 04:40 UTC

This package is not auto-updated.

Last update: 2024-04-28 03:30:52 UTC


README

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 文档