mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-03-12 10:36:09 +03:00
*Context*: NelmioApiDocBundle does not require clients to have the symfony/validator package. However it requires it in its dev dependencies. *Problem*: If client of library does not have symfony/validator and uses PHP8, NelmioApiDocBundle will assume that symfony/validator is installed, in `SymfonyConstraintAnnotationReader.php` *Solution*: We should not assume that client has symfony/validator. So before reading attributes of this class, we now try to see if class exists. - Tests still run. - Tested in a project without symfony/validator and requiring this version, it now works. The error before this fix was : Exception: `ClassNotFound` Message for me: `Attempted to load class "Constraint" from namespace "Symfony\Component\Validator". Did you forget a "use" statement for e.g. "JsonSchema\Constraints\Constraint" or "Doctrine\DBAL\Schema\Constraint"?`
NelmioApiDocBundle
The NelmioApiDocBundle bundle allows you to generate a decent documentation for your APIs.
Migrate from 2.x to 3.0
To migrate from 2.x to 3.0, follow our guide.
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
Contributing
See CONTRIBUTING file.
Running the Tests
Install the Composer dependencies:
git clone https://github.com/nelmio/NelmioApiDocBundle.git
cd NelmioApiDocBundle
git checkout 3.x
composer update
Then run the test suite:
./phpunit
License
This bundle is released under the MIT license.
Description
Languages
PHP
86.4%
Twig
11%
CSS
2.5%