1

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?

1
  • Hi @Pony Tylor check my lastest answer to your question, the solution with the condition is not working fine (I try to investigate more before remove it) Commented Aug 25, 2015 at 11:19

3 Answers 3

1

try

       condition= "request.query.get('order') == 'something' "

instead of

       condition= "request.get('order') == 'something' "

check more help here and here

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

0

I suggest you to use the requirements attribute as follow:

/**
 * @Route(
 *      "/api/list/{setName}/{order}",
 *       requirements={"order":"something"}"
 *
 * )
 */

Hope this help

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.