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 708 forks source link

Symfony 6.4 adds `@final` annotation to Route annotation/attribute class #2397

Closed mbabker closed 5 months ago

mbabker commented 7 months ago

Symfony 6.4 adds the @final annotation to the Symfony\Component\Routing\Attribute\Route class (the annotation classes are all moved to a new Attribute namespace with a proxy layer), so anyone using the annotation/attribute classes from this bundle will get unfixable deprecation notices because of that.

kevinpapst commented 6 months ago

I am currently investigating all kind of deprecations and luckily this one is easy to solve and also reduces the bundle coupling (which seems to be a good idea in the long run anyway).

So simply search & replace those:

mbabker commented 5 months ago

Annotation removed upstream, all good here.

kevinpapst commented 5 months ago

@mbabker thanks for sharing feedback with SF Team. It took me quite a while to replace all annotations in various bundles and to me it feels better to reduce the coupling and stick with the basic SF attributes.

Is there any benefit in using the ones from FOSRest? E.g. NelmioApiDoc supports both versions...

mbabker commented 5 months ago

It's all personal choice. The ones here are just shortcuts that read a little nicer in code (#[Post('/foo')] versus #Route('/foo', methods: ['POST'])]), some folks make extended attribute classes to shorthand some duplicated config. It doesn't really matter if you use the core Route class or anything subclassing it as most tooling should work with them all.

kevinpapst commented 5 months ago

That's what I thought. I do see the benefits for reducing redundant configuration and this final was probably too much ... but these occurrences are also good to question the own behavior. Thanks for the clarification 👍