FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony
http://symfony.com/doc/master/bundles/FOSRestBundle/index.html
MIT License
2.79k stars 703 forks source link

Symfony 6.3 annotation issue #2389

Closed hual7 closed 6 months ago

hual7 commented 1 year ago
Q A
Symfony Version 6.3
Sulu Version 2.5.9
Related Issue https://github.com/sulu/SuluArticleBundle/issues/641

After upgrading to Symfony 6.3 console shows a semantical error

[Semantical Error] The annotation "@FOS\RestBundle\Controller\Annotations\Get" in method Sulu\Bundle\ArticleBundle\Controller\ArticleController::getAction() was never imported. Did you maybe forget to add a "use" statement for this annotation? in /vendor/sulu/article-bundle/Resources/config/routing_api.yml (which is being imported from "/config/routes/sulu_admin.yaml"). Make sure there is a loader supporting the "rest" type.

[Semantical Error] The annotation "@FOS\RestBundle\Controller\Annotations\Get" in method Sulu\Bundle\ArticleBundle\Controller\ArticleController::getAction() was never imported. Did you maybe forget to add a "use" statement for this annotation?

vsko-dev commented 1 year ago

Hi same for me in two places for Symfony 6.3: [info] User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::build()" might add "void" as a native return type declaration in the future. Do the same in child class "FOS\RestBundle\FOSRestBundle" now to avoid errors or add an explicit @return annotation to suppress this message.

PHP Deprecated: Since symfony/serializer 6.3: Not implementing the "NormalizerInterface::getSupportedTypes()" in "FOS\RestBundle\Serializer\Normalizer\FormErrorNormalizer" is deprecated. in /app/vendor/symfony/deprecation-contracts/function.php on line 25

@mbabker can you help?

mbabker commented 1 year ago

Neither of those deprecations are related to this annotations issue.

But, for the serializer one, https://github.com/FriendsOfSymfony/FOSRestBundle/pull/2388 seems like it would address it.

shakaran commented 1 year ago

I will love getting this merged. I this the only few SF 6.3 deprecations warnings that I have in several projects since ApiPlataform already update this same problem too.

shakaran commented 6 months ago

@goetas I think that it is safe close this issue since already merged. Thanks