zircote/swagger-php
swagger-php generates OpenAPI 3.0/3.1/3.2 documentation from your PHP 8.2+ code using attributes (preferred) or optional Doctrine annotations. Use it via CLI or programmatically, with helpful error reporting and a full documentation site.
We recommend adding swagger-php to your project using Composer
> composer require zircote/swagger-php
Alternatively, use the composer global argument to install swagger-php globally.
> composer global require zircote/swagger-php
::: warning PATH variables
Remember to add the ~/.composer/vendor/bin directory to the PATH in your environment.
:::
swagger-php version 5.5 introduces a new type resolver used internally to determine the schema type
of properties (and other elements with a schema).
By default, a custom LegacyTypeResolver is used. If you are on PHP 8.2 or higher,
the TypeInfoTypeResolver can be used instead.
For this the radebatz/type-info-extras package is required.
Since it is optional, it needs to be installed manually:
composer require radebatz/type-info-extras
::: warning Additional dependencies
Installing radebatz/type-info-extras will also add symfony/type-info as a dependency.
:::
As of version 4.8 the doctrine annotations library is optional and no longer installed by default.
If your code uses doctrine annotations, you will need to install that library manually:
composer require doctrine/annotations
How can I help you explore Laravel packages today?