nelmio / NelmioApiDocBundle

Generates documentation for your REST API from annotations
MIT License
2.21k stars 828 forks source link

add check for missing required dependencies #2270

Closed maglnet closed 2 months ago

maglnet commented 2 months ago
Q A
Bug fix? yes
New feature? no
Deprecations? no
Issues

Within a project of mine, I updated all dependencies and after that I got an error because of a missing Class. This happens because the symfony/validator package is not defined as a dependency (only as a dev-dependency) but it seems to be required not only in tests.

This PR does the following:


Error: Class "Symfony\Component\Validator\Constraint" not found
/project-dir/vendor/nelmio/api-doc-bundle/src/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php:217
/project-dir/vendor/nelmio/api-doc-bundle/src/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php:196
/project-dir/vendor/nelmio/api-doc-bundle/src/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php:59
/project-dir/vendor/nelmio/api-doc-bundle/src/ModelDescriber/Annotations/AnnotationsReader.php:71
/project-dir/vendor/nelmio/api-doc-bundle/src/ModelDescriber/ObjectModelDescriber.php:174
/project-dir/vendor/nelmio/api-doc-bundle/src/Model/ModelRegistry.php:115
/project-dir/vendor/nelmio/api-doc-bundle/src/ApiDocGenerator.php:135
/project-dir/vendor/nelmio/api-doc-bundle/src/Render/RenderOpenApi.php:85
/project-dir/tests/src/ValidOpenAPISyntaxTest.php:32
DjordyKoert commented 2 months ago

The error you encountered should be fixed with https://github.com/nelmio/NelmioApiDocBundle/pull/2276 :)

maglnet commented 2 months ago

Thanks @DjordyKoert . So I'll close this as obsolete.