NelmioApiDocBundle is an MIT-licensed Symfony bundle that generates REST API documentation from PHP 8 attributes, built for PHP and Symfony teams that want OpenAPI descriptions derived from their code rather than written and maintained by hand.
What it is
NelmioApiDocBundle is a Symfony bundle distributed on Packagist as nelmio/api-doc-bundle. It lives in the PHP and Symfony ecosystem and generates API documentation from attributes declared in application code. Version 5.x requires PHP 8.1 or higher and a minimum Symfony version of 6.4, and its release line has moved annotations out entirely in favour of PHP 8 attributes. The bundle reached OpenAPI 3.0 support in version 4.0; projects that must stay on Swagger 2.0 are directed to version 3 of the bundle.
The concrete problem it solves is documentation drift: the API description is produced from the same attributes that sit next to the controllers, so it does not have to be authored and re-authored as a separate artefact whenever endpoints change. It replaces hand-maintained API description documents with generated output, and it replaces the older annotation-based authoring style that the bundle supported before 5.x. The project carries 2,368 stars, 910 forks and 55 open issues, with the last push in September 2026.
Key capabilities
- Generates documentation for REST APIs from PHP 8 attributes rather than annotations, which were removed in version 5.0.
- Supports OpenAPI 3.0 from version 4.0 onward; Swagger 2.0 documentation requires staying on version 3 of the bundle.
- Installs as the Composer package
nelmio/api-doc-bundle, a standard Symfony bundle.
- Runs under FrankenPHP worker mode and other long-running workers, with a dedicated documentation page for that deployment shape.
- Ships upgrade guides for each major transition:
UPGRADE-3.0.md, UPGRADE-4.0.md and UPGRADE-5.0.md.
- Carries a topic list that names
swagger-php, redoc, openapi and symfony-bundle, placing it in the surrounding OpenAPI tooling family.
- Maintains a test suite runnable through
composer phpunit after composer update.
Who uses it and how
- Symfony applications on version 6.4 or later and PHP 8.1 or later, which is the supported baseline for the 5.x line.
- Teams moving from annotation-based API declarations to PHP 8 attributes, following the 5.0 migration guide.
- Projects that adopted OpenAPI 3.0 during the 4.0 transition and previously stayed on Swagger 2.0 output.
- Deployments running under FrankenPHP worker mode or another long-running worker, where the bundle has documented support.
- Contributors and maintainers, who clone the repository and run
composer update followed by composer phpunit.
Getting started
Install with composer require nelmio/api-doc-bundle from the project directory. Full setup and usage documentation is published on symfony.com under the NelmioApiDocBundle section.
How it compares
No list of paid products this project replaces is provided in the facts. Its topic list names swagger-php and redoc alongside openapi, so it sits within the PHP OpenAPI tooling family rather than standing apart from it. Beyond those names, the facts do not establish how it relates feature by feature to any other tool, so no direct comparison is drawn here.
When to use it — and when not to
The bundle is a library, not a service, so a self-hoster operates no database, storage layer or mail server on its behalf. It should not be chosen for applications that are not built on Symfony, for stacks below Symfony 6.4, or for PHP versions below 8.1, since those are hard requirements of the current line; projects that need Swagger 2.0 output must pin version 3 instead. Its README is deliberately sparse and defers most substance to the symfony.com documentation and the per-version upgrade guides, so expect to read outside the repository to get a full picture.
project readme (upstream, from github) — read inline
NelmioApiDocBundle

The NelmioApiDocBundle bundle allows you to generate a decent documentation
for your APIs.
Installation
Open a command console, enter your project directory and execute the following command to download the latest version of this bundle:
composer require nelmio/api-doc-bundle
Documentation
Read the documentation on symfony.com
Migrate from 4.x to 5.0
To migrate from 4.x to 5.0, follow our guide.
This version comes with the following major changes:
- The bundle now requires PHP 8.1 or higher.
- Support for annotations has been removed in favor of PHP 8 attributes.
- Minimum Symfony version is now 6.4.
- Major cleanup and simplification of the codebase.
FrankenPHP worker mode
The bundle also runs under FrankenPHP worker mode and other long-running workers, see
FrankenPHP and long-running workers.
Migrate from 3.x to 4.0
To migrate from 3.x to 4.0, follow our guide.
Version 4.0 brings OpenAPI 3.0 support. If you want to stick to Swagger 2.0, you should use the version 3 of this bundle.
Migrate from 2.x to 3.0
To migrate from 2.x to 3.0, follow our guide.
Contributing
See
CONTRIBUTING
file.
Running the Tests
Install the Composer dependencies:
git clone https://github.com/nelmio/NelmioApiDocBundle.git
cd NelmioApiDocBundle
composer update
Then run the test suite:
composer phpunit
Sponsored by
JetBrains sponsors this project by providing an open-source license for their tools.
License
This bundle is released under the MIT license.