loot/otium

该包可以生成API文档而无需任何操作

0.1 2020-04-12 08:40 UTC

This package is auto-updated.

Last update: 2024-09-28 18:05:29 UTC


README

无需使用Swagger、OpenApi注释即可生成API文档

目前运行在l5-swagger包之上

compare

安装

composer require loot/otium

然后运行

php artisan vendor:publish --provider="Loot\Otium\ServiceProvider"

配置

可以在config/otium.php文件中进行设置

用法

在运行命令php artisan l5-swagger:generate后,启动

php artisan loot:generate-docs

Otium注解

@param-otium-hint

由于GET请求不使用FormRequest,otium无法获取文档信息。

为了文档化FormRequest中不存在的参数,请使用注解@param-otium-hint

/**
 * @param-otium-hint {"name": "search", "description": "keyword for search", "in": "query", "required": false}
 */

@param-otium-extra

在需要向文档中添加自定义属性的情况下,请使用@param-otium-extra

/**
 * @param-otium-extra {"ENV": "LOCAL"}
 * @param-otium-extra {"params": {"timeout": 300} }
 */

待办事项

路线图在此处可用 https://trello.com/b/XNh0t5g0/otiums-roadmap