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

symfony controller method action suffix #2328

Open stijn-at-work opened 2 years ago

stijn-at-work commented 2 years ago

We are upgrading our app to Symfony 4. The Symfony docs state that the action suffix is no longer needed for controller method names.

The first Symfony versions required that controller method names ended in Action (e.g. newAction(), showAction()). This suffix became optional when annotations were introduced for controllers. In modern Symfony applications this suffix is neither required nor recommended, so you can safely remove it.

Our controller methods extend AbstractFosRestController.

When removing the Action suffix and run bin/console debug:route, I get an error.

Are you planning to update the source code to comply with this Symfony recommendation?

W0rma commented 2 years ago

When removing the Action suffix and run bin/console debug:route, I get an error.

Which error do you get and which version of FOSRestBundle do you use?

InjustFr commented 2 years ago

This is probably not an issue with FOSRestBundle. All my controller methods do not have an action suffix and they work just fine

shakaran commented 11 months ago

@stijn-at-work since a lot time have past, do you have still the same experiencie with Symfony 5 or 6 version?