1

I follow tutorial in here (http://npmasters.com/2012/11/25/Symfony2-Rest-FOSRestBundle.html) about using FOSRestBundle.

When setting up the route, I get error :

Cannot import resource "D:\xampp\htdocs\SymRestTestApp\src\Per\RestBundle/Resources/config/routing.yml" from "D:/xampp/htdocs/SymRestTestApp/app/config\routing.yml". 

My app/config/routing.yml

per_rest:
    resource: "@PerRestBundle/Controller"
    type: annotation
    prefix: /

per:
    type: rest
    resource: "@PerRestBundle/Resources/config/routing.yml"

My Per/RestBundle/Resources/config/routing.yml:

organisation:
    type: rest
    resource: Per\RestBundle\Controller\OrganisationController

user:
    type: rest
    parent: organisation
    resource: Per\RestBundle\Controller\UserController

Anyone experience this issue? How to fixed this error?

1 Answer 1

0

I just pushed a commit to the repository which should fix this issue. See: https://github.com/nmpolo/Symfony2Rest/commit/d381b0a4652e76d5a4c1576d1afd8fa0e00eb0c1

This was being caused because the FOSRestBundle now requires you to implement ClassResourceInterface in your controllers to use implicit routing. See: https://github.com/FriendsOfSymfony/FOSRestBundle/blob/master/Resources/doc/5-automatic-route-generation_single-restful-controller.md#implicit-resource-name-definition

3

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.