Closed codeneuss closed 3 years ago
This is expected. The first route that matches a request is taken into account. The router does not know that your first route should not match arbitrary strings. Possible solutions are adding requirements to more specific routes or to reorder your routes that more specific ones are defined later.
You can read more about this in the Symfony documentation: https://symfony.com/doc/current/routing.html#parameters-validation
Hi,
I'm using Version 3.0.4 of FOSRestBundle with Symfony 4.4.18. I have a crontroller with some actions:
When I call
console debug:routes
I getapp_sample_cget_filter /rest/v1/sample/filter
. But when I callconsole router:match /rest/v1/sample/filter
I get SampleController::getAction as answer.The same happens when I call the route in postman or browser. I recently updated from sf 3.4 to 4.4 and of course from the corresponding FosRestBundle Version to the current stable.
I've found a workaround with a requirement in the Route-Definition of the /{id} route with requirements.
Is this a bug or is it wrong configuration?
Thanks alot
codeneuss