You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
We use Symfony in conjunction with nelmio/api-doc-bundle. When upgrading everything to v4.2.2 this Exception is thrown when trying to access the generated API documentation via browser:
TypeError:
Argument 1 passed to Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::__construct() must implement interface Doctrine\Common\Persistence\Mapping\ClassMetadataFactory, instance of Doctrine\ORM\EntityManager given, called in /app/var/cache/dev/Container8xam11G/getDoctrine_Orm_DefaultEntityManager_PropertyInfoExtractorService.php on line 9
at vendor/symfony/doctrine-bridge/PropertyInfo/DoctrineExtractor.php:32
at Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor->__construct(object(EntityManager))
(var/cache/dev/Container8xam11G/getDoctrine_Orm_DefaultEntityManager_PropertyInfoExtractorService.php:9)
at require('/app/var/cache/dev/Container8xam11G/getDoctrine_Orm_DefaultEntityManager_PropertyInfoExtractorService.php')
(var/cache/dev/Container8xam11G/srcApp_KernelDevDebugContainer.php:158)
at Container8xam11G\srcApp_KernelDevDebugContainer->load('getDoctrine_Orm_DefaultEntityManager_PropertyInfoExtractorService.php')
(var/cache/dev/Container8xam11G/getPropertyInfoService.php:14)
at Container8xam11G\srcApp_KernelDevDebugContainer->{closure}()
(vendor/symfony/property-info/PropertyInfoExtractor.php:108)
at Symfony\Component\PropertyInfo\PropertyInfoExtractor->extract(object(RewindableGenerator), 'getTypes', array('App\\Entity\\SomeResourceEntity', 'id', array()))
(vendor/symfony/property-info/PropertyInfoExtractor.php:74)
at Symfony\Component\PropertyInfo\PropertyInfoExtractor->getTypes('App\\Entity\\SomeResourceEntity', 'id')
(vendor/nelmio/api-doc-bundle/ModelDescriber/ObjectModelDescriber.php:80)
at Nelmio\ApiDocBundle\ModelDescriber\ObjectModelDescriber->describe(object(Model), object(Schema))
(vendor/nelmio/api-doc-bundle/Model/ModelRegistry.php:95)
at Nelmio\ApiDocBundle\Model\ModelRegistry->registerDefinitions()
(vendor/nelmio/api-doc-bundle/ApiDocGenerator.php:72)
at Nelmio\ApiDocBundle\ApiDocGenerator->generate()
(vendor/nelmio/api-doc-bundle/Controller/SwaggerUiController.php:53)
at Nelmio\ApiDocBundle\Controller\SwaggerUiController->__invoke(object(Request), 'default')
(vendor/symfony/http-kernel/HttpKernel.php:150)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:67)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:198)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(public/index.php:37)
SomeResourceEntity in this case is your run of the mill Doctrine Entity object with a numeric id field, nothing fancy.
I won't completely rule out that this might be a problem in nelmio/api-doc-bundle, but downgrading symfony/property-info to ~4.1 definitely gets rid of the problem; which is not satisfactory of course. Please advise.
The text was updated successfully, but these errors were encountered:
Symfony version(s) affected: 4.2.2
Description
We use Symfony in conjunction with
nelmio/api-doc-bundle
. When upgrading everything to v4.2.2 this Exception is thrown when trying to access the generated API documentation via browser:How to reproduce
Example phpdoc processed by the api doc bundle:
SomeResourceEntity
in this case is your run of the mill Doctrine Entity object with a numeric id field, nothing fancy.I won't completely rule out that this might be a problem in
nelmio/api-doc-bundle
, but downgradingsymfony/property-info
to ~4.1 definitely gets rid of the problem; which is not satisfactory of course. Please advise.The text was updated successfully, but these errors were encountered: