Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Multiple @Route statements #324

alex88 opened this Issue · 5 comments

3 participants


Hello guys,

I've tried this code

 * @Rest\Route("/user/details", defaults={"_format" = "json"})
 * @Rest\Route("/user/info", defaults={"_format" = "json"})
 * @Rest\View
 * Returns the actual logged user informations
 * @return User $user the logged user, serialized
public function infoAction()
    $user = $this->getUser();
    return array('user' => $user);

and I've seen that only the first route is matched. Instead, the SensioFrameworkExtraBundle's Route annotation permits to include multiple route statements as stated here:

Is it something related to this bundle or just a my problem?


i cannot reproduce the issue:

gives me:

$ app/console router:debug | grep extra
_extra_noname                     ANY    ANY      /liip/extra.{_format}
_extra_name                       ANY    ANY      /liip/extra/{name}.{_format}

Strange, don't worry, I've switched over the bundle to a custom controller.

@alex88 alex88 closed this

This is indeed a valid issue. The FosRest @Route (and aliases) annotation will only generate for the first given route.
@lsmith77's link to Liip isn't relevant, as it's using the Sensio route annotation, not FosRest.


can you create a failing test case?

@lsmith77 lsmith77 reopened this

I'll see if I can get to it later this weekend, in a crunch atm :-)

@blongden blongden referenced this issue from a commit
@jmikola jmikola Do not clobber existing client definitions (closes #336 and #324)
While we could have used an abstract definition, its ID would likely conflict with the alias we set for the default client. Remove the abstract definition altogether and simply construct new definitions for each client. This resolves the previous issue where multiple clients would overwrite the constructor arguments of the previous definition.
@lsmith77 lsmith77 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.