DieSchittigs / contao-content-api-bundle

Contao JSON-API
MIT License
41 stars 9 forks source link

Wrong annotation #6

Closed emha closed 5 years ago

emha commented 5 years ago

Trying to install it in contao 4.4.24 an get the following error:

[Semantical Error] The annotation "@Sensio\Bundle\FrameworkExtraBundle\Conf iguration\Route" in class DieSchittigs\ContaoContentApiBundle\Controller\Co ntentApiController does not exist, or could not be auto-loaded in /home/mal te/projects/aixterior/vendor/dieschittigs/contao-content-api/src/Controller (which is being imported from "/home/malte/projects/aixterior/vendor/diesc hittigs/contao-content-api/src/ContaoManager/../Resources/config/routing.ym l"). Make sure annotations are installed and enabled.

Seems like it has to be changed to

Symfony\Component\Routing\Annotation\Route

padarom commented 5 years ago

The annotation references the namespace of sensio/framework-extra-bundle specifically. I assume this used to be a dependency of one of the Contao core bundles up until around 4.4.24 and is not anymore. Adding it to our dependency list might do the trick, but we'll have to see if that's necessary with Symfony\Component\Routing\Annotation\Route present.

padarom commented 5 years ago

Apparently Sensio\Bundle\FrameworkExtraBundle\Configuration\Route has been deprecated in Symfony 5.2 in favor of Symfony\Component\Routing\Annotation\Route, so the latter should be used anyway.

See https://symfony.com/doc/master/bundles/SensioFrameworkExtraBundle/annotations/routing.html

It was dropped in Contao 4.4.24 for exactly that reason: https://github.com/contao/contao/commit/fb16b1e71a1b8fd794da0f9bc01661ca69f02686

@saibotd Should I draft a PR that replaces the Route references?