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.
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
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
Open API coverage: 75%
+- Missing documentation -+
| path | method |
+---------------+---------+
| /products/:id | get |
+---------------+---------+