I am trying to set up the following route
/**
* @Route(
* "/api/list/{setName}/{order}",
* condition= "request.get('order') == 'something' "
*
* )
*/
but I can only produce 404s because the condition is never true although I pass in an order argument. I guess the "request.get('order')" part is wrong, but how to do it?
try
condition= "request.query.get('order') == 'something' "
instead of
condition= "request.get('order') == 'something' "
check more help here and here
Looking at the Routing docs with conditions, I don't find any reference to an annotation definition for route conditions. You should probably use another format.
I suggest you to use the requirements
attribute as follow:
/**
* @Route(
* "/api/list/{setName}/{order}",
* requirements={"order":"something"}"
*
* )
*/
Hope this help