ferror/openapi-coverage

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

This package is auto-updated.

Last update: 2024-05-03 21:40:10 UTC


README

Coverage Status

Open API Coverage Calculator Symfony Bundle

The Open API Coverage Calculator Symfony Bundle enables you to track another system metric - The API Documentation Coverage. The library extracts your application API endpoints via Symfony Routing and checks them against NelmioAPIDocBundle, the most popular library for Open API Specification in the Symfony ecosystem.

Installation

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

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

Usage

php bin/console ferror:check-openapi-coverage

You can also specify the --threshold or (--t) option to define coverage level below which the command will fail.

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

Example Result

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