title: Symfony routing, controller method Not Found 404 even though the router is defined
body: <p>Ok so I am using symfony 3.3, yml routing and the Nelmio documentation bundle. 
  I have a Public Bundle, which contains a Controller/SearchController.php with a GET method inside of it, method which is somehow Not Found.</p>
  
  <p>The symfony debug:router finds this method as:</p>
  
  <pre><code>  Name         Method  Scheme  Host  Path
    get_public   GET     ANY     ANY   /public/search/current.{_format} `
  </code></pre>
  
  <p>Nelmio recognizes it too. 
  But if I am to make the call, it gives me a 404 both in Nelmio and Postman.
  I am using fos rest, configured like this in app/config.config.yml:</p>
  
  <pre><code>fos_rest:
      param_fetcher_listener: true
      routing_loader:
          default_format: json
      view:
          view_response_listener: true
          formats:
              json: true
              xml: false
              rss: false
  </code></pre>
  
  <p>I am really stuck, please help, here is my routing.yml: </p>
  
  <p>in app/config/routing.yml:</p>
  
  <pre><code> public:
       type: rest
       resource: "@PublicBundle/Resources/config/routing.yml"
  </code></pre>
  
  <p>in src/PublicBundle/Resources/config/routing.yml:</p>
  
  <pre><code>search_controller:
      type: rest
      resource: "PublicBundle\\Controller\\SearchController"
      prefix: /public/search
      defaults: {_format: json}
  </code></pre>
  
  <p>and my controller: </p>
  
  <pre><code>    &lt;?php
  
      namespace PublicBundle\Controller;
  
      use Symfony\Component\HttpFoundation\Request;
      use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  
      // all FOS stuff that made Nelmio work:
      use FOS\RestBundle\Request\ParamFetcher;
      use FOS\RestBundle\View\View;
      use FOS\RestBundle\Controller\FOSRestController;
      use FOS\RestBundle\Controller\Annotations;
      use FOS\RestBundle\Controller\Annotations\RouteResource;
      use FOS\RestBundle\Controller\Annotations\Get;
  
      use JMS\Serializer as Serializer;
      use Nelmio\ApiDocBundle\Annotation\ApiDoc;
      use Symfony\Component\HttpFoundation\Response;
      use Doctrine\Common\Util\Debug as Debug;
      /**
       * Class SearchController
       * @RouteResource("Public", pluralize=false)
       */
  
      class SearchController extends FOSRestController
      {
  
          /**
           *
           * @ApiDoc(
           *   resource = true,
           *    section = "Public Resource API",
           *    description = "nelmio doc test",
           *    statusCodes = {
           *     200 = "Returned when successful",
           *     400 = "Bad Request: returned when parameters are not of required type"
           *   }
           * )
           * @GET("/current")
           * @Route("/current")
           * @param $request
           * @return View
           */
          public function getAction(Request $request)
          {
              $view = View::create();
              return $view-&gt;setData(['test'=&gt;'test'])-&gt;setStatusCode(Response::HTTP_OK);
          }
      }
  </code></pre>
  
  <p>But when trying that route, it throws 404 both from Nelmio(Chrome) and  Postman. </p>
  
  <p>GET my-api.com/public/search/current.json</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="UTF-8" /&gt;
          &lt;title&gt;An Error Occurred: Not Found&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h1&gt;Oops! An Error Occurred&lt;/h1&gt;
          &lt;h2&gt;The server returned a "404 Not Found".&lt;/h2&gt;
  
          &lt;div&gt;
              Something is broken. Please let us know what you were doing when this error occurred.
              We will fix it as soon as possible. Sorry for any inconvenience caused.
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>EDIT: Oh, just to add, tailing apache errors I get this, which I don't find useful:</p>
  
  <pre><code>"GET /public/search/current?_format=json HTTP/1.1" 404 717 "http://api-netvlies.com/doc" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/58.0.3029.110 Chrome/58.0.3029.110 Safari/537.36"
  </code></pre>