You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried the condition mentioned there and sent a request to http://localdomain.tld/api/v1/element/get/123, it resulted in a route not found exception. Changing the match value from 'v1' to null resulted in a successful response. It seems the request attributes are not available for the condition.
How to reproduce
Since I figured it might be related to an installed bundle, I set up a separate skeleton with the minimal required composer packages and reproduced the issue.
Thanks @xabbuh . That seems to work. Also works with multiple versions by using "v1|v2", in case anyone encounters this. I created a pull request as requested.
Symfony version(s) affected: Tested with 5.1.5
Description
I ran into this issue when setting up the FOSRestBundle.
https://symfony.com/doc/3.x/bundles/FOSRestBundle/versioning.html#how-to-match-a-specific-version-in-my-routing
When I tried the condition mentioned there and sent a request to http://localdomain.tld/api/v1/element/get/123, it resulted in a route not found exception. Changing the match value from 'v1' to null resulted in a successful response. It seems the request attributes are not available for the condition.
How to reproduce
Since I figured it might be related to an installed bundle, I set up a separate skeleton with the minimal required composer packages and reproduced the issue.
Create src/Controller/TestController.php
Request the action by navigating to http://localdomain.tld/api/v1/element/get/123
This results in: No route found for "GET /api/v1/element/get/123"
Changing 'v1' to null in the condition and reloading the request results in:
So apparently the version attribute is there, but not for the condition.
The text was updated successfully, but these errors were encountered: