0
votes

I'm using the FOSRestBundle and would like to modify the routes it creates. I intend to add default parameters to each route the Rest Bundle creates. I've looked through the symfony docs on routing and have found nothing covering this use case.

If there is no way I would either have to

  • modify the FOS Rest Bundle directly

  • Or copy its route loader code, make my changes, and add it to my own bundle (and not use the Rest Bundle routing at all.)

I don't like either option.

Does Symfony offer a hook that allow for post processing of routes?

1

1 Answers

2
votes

FosRestBundle have a custom route loader. If you look in the github repository you will see that the routes are defined in the RestActionReader.php file. So the only solution is to override it and replace the class associate to the service fos_rest.routing.loader.reader.action