0

Hello i have a strange problem, while using FostRestBundle.

First error is :

InvalidArgumentException: Every parent controller must have get{SINGULAR}Action($id) method where {SINGULAR} is a singular form of associated object

And the second one :

Cannot import resource "/home/a15net/public_html/game/src/ATL/ContentBundle/Resources/config/api_routing.yml" from "/home/a15net/public_html/game/app/config/routing.yml".

I'v checked my all "YAML" files but there was no indent problems.

Tried to update composer twice nothing helped.

Edit : Config.yml > http://goo.gl/dqCAu

Canser Yanbakan
  • 3,780
  • 3
  • 39
  • 65

2 Answers2

1

You have to remove the 'type' from this import statement fro your routing.yml

atl_content_api:
    resource: "@ATLContentBundle/Resources/config/api_routing.yml"

Inside the api_routing.yml you can specify the rest type for each controller like,

acme_user_rest:
    resource: Acme\UserBundle\Controller\UserRestController
    prefix: /api
    type: rest

this blog will help you to implement the sme

Nisam
  • 2,275
  • 21
  • 32
0

--- NOT --- SOLUTION :

If a route has a parent route, you must not put "type:rest" to it. You have to use "type:rest" only in parent routes.

Sample :

catalogs:
    type: rest
    prefix: api
    resource: ATL\CatalogBundle\Controller\API\CatalogsController
    options:
        expose: true
taxonomy:
    parent: catalogs
    resource: ATL\CatalogBundle\Controller\API\TaxonomyController
    options:
        expose: true 

I will not choose this as correct answer until more comments and other solution suggestions writed.

Edit

When you remove type:rest from children route, it is not a rest route anymore.

Canser Yanbakan
  • 3,780
  • 3
  • 39
  • 65
  • In the case that you have more than one parent you should ONLY add type:rest to the parent routes. This fixed my problem with multiple nested "parent" routes. – Thomas Bennett May 20 '14 at 19:43