ferror/openapi-coverage

0.1.0-beta 2024-01-03 20:40 UTC

This package is auto-updated.

Last update: 2024-09-03 22:24:15 UTC


README

Coverage Status

Open API Coverage Calculator Symfony Bundle

Open API Coverage Calculator Symfony Bundle 允许您跟踪另一个系统指标 - API 文档覆盖率。该库通过 Symfony 路由提取您的应用程序 API 端点,并与最受欢迎的 Open API 规范库 NelmioAPIDocBundle 以及在 Symfony 生态系统中的库进行比较。

安装

composer require --dev ferror/openapi-coverage
// bundles.php

return [
    Ferror\OpenapiCoverage\Symfony\Bundle::class => ['dev' => true, 'test' => true],
];

使用方法

php bin/console ferror:check-openapi-coverage

您还可以指定 --threshold 或 (--t) 选项来定义覆盖率级别,低于该级别的命令将失败。

php bin/console ferror:check-openapi-coverage --threshold 0.70

示例结果

Open API coverage: 75%
+- Missing documentation -+
| path          | method  |
+---------------+---------+
| /products/:id | get     |
+---------------+---------+