Installation ​
Per project ​
We recommend adding swagger-php to your project using Composer
> composer require zircote/swagger-phpGlobally ​
Alternatively, use the composer global argument to install swagger-php globally.
> composer global require zircote/swagger-phpPATH variables
Remember to add the ~/.composer/vendor/bin directory to the PATH in your environment.
Type resolvers ​
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-extrasAdditional dependencies
Installing radebatz/type-info-extras will also add symfony/type-info as a dependency.
Using doctrine annotations ​
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