title: Mixing route and query parameters using FOSRestBundle with Symfony
body: <p>Using Symfony2 and FOSRestBundle I am attempting to implement API methods that have some number of fixed parameters defined in the route along with some optional parameters that may exist in the query string.</p>
  
  <p>For example:</p>
  
  <pre><code> http://somesite.com/api/method/a/b
   http://somesite.com/api/method/c/d?x=1&amp;y=2
  </code></pre>
  
  <p>According to <a href="https://github.com/FriendsOfSymfony/FOSRestBundle/blob/master/Resources/doc/3-listener-support.md">the documentation for FOSRestBundle</a>, ParamFetcher is the proper way to do this, using the @QueryParam annotation. However, I already have a controller defined like:</p>
  
  <pre><code> use Symfony\Bundle\FrameworkBundle\Controller\Controller;
   use FOS\RestBundle\Controller\Annotations\Get;
   use FOS\RestBundle\Controller\Annotations\View;
  
   class MyController extends Controller
   {
  
     /**
      * @Get("/method/{a}/{b}")
      * @View()
      */
     public function getMethodAction($a, $b)
     {
       // do stuff
  
       return array('foo' =&gt; 'bar');
     }
  
   }
  </code></pre>
  
  <p>Now it seems I need to be able to get access to an instance of ParamFetcher, but I don't know how (and Google searches have not helped much). I know from the documentation that I can simply change the method signature to incorporate ParamFetcher, however, when I do that it moves the parameters into the query string, which I can't have.</p>
  
  <p>Is there a way to mix the two, or should I give up on ParamFetcher and go to just inspecting the request directly using Symfomy's built-in Request object?</p>