I am trying to setup the symfony3 codebase with FOS REST Bundle and I end up getting no route found error
AppBundle\Resources\config\api-routing.yml
check:
type: rest
resource: "@AppBundle/Controller/CheckController.php"
app\config\routing.yml
app:
type: rest
prefix: /
resource: '@AppBundle/Resources/config/api-routing.yml'
controller
namespace AppBundle\Controller;
use FOS\RestBundle\Controller\FOSRestController;
use FOS\RestBundle\Controller\Annotations\Version;
use FOS\RestBundle\Controller\Annotations\RouteResource;
use Symfony\Component\HttpFoundation\Request;
/**
* @RouteResource("Check")
* @Version("v1")
*/
class CheckController extends FOSRestController
{
public function getAction(Request $request)
{
$data = "Ok";
return new JsonResponse($data);
}
}
http://127.0.0.1:8000/v1/app/check/ return no route
I would like to integrate the versioning of rest api route. Can you share what cud be the error and how can I correct this ?
fos_rest:
body_listener: true
versioning:
enabled: true
resolvers:
query:
enabled: true
parameter_name: version
format_listener:
rules:
- { path: '^/', priorities: ['json'], fallback_format: json, prefer_extension: false }
param_fetcher_listener: true
view:
view_response_listener: 'force'
formats:
json: true