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

Add support for native PHP8 QueryParam, FileParam and RequestParam attributes #2327

Closed W0rma closed 2 years ago

W0rma commented 2 years ago

Closes #2301

mbabker commented 2 years ago

How about making the annotations reader for the FOS\RestBundle\Request\ParamReader class optional? Right now, the class has a hard dependency on doctrine/annotations and all the Symfony classes made the Reader argument optional when attributes support was added.

W0rma commented 2 years ago

How about making the annotations reader for the FOS\RestBundle\Request\ParamReader class optional?

Good idea. Thank you for the hint! See a0377b2

diegozavaletatelanto commented 2 years ago

Amazing feature, this will help us, to use PHP Attributes instead of annotations (we need to import the Class, but looks like unused import). Thanks for your contribution.

goetas commented 2 years ago

@W0rma do you have anything to add to this PR? I personally think that is fine and I would like to proceed with the merge, what do you think?

W0rma commented 2 years ago

@goetas I tested my branch in a real life project and it worked fine. Therefore, I think it can be merged.

I'm looking forward to the next release with symfony6 and full attribute support :)