当我将项目从2.8升级到Symfony 3.4时,我将FOSUserBundle从2.1升级到了2.4。
使用与之前相同的代码,以及此yml
文件:
# app/config/routing.yml
api_request_backend:
type: rest
prefix: /api
resource: "@AppBundle/Resources/config/default.yml"
-
# AppBundle/Resources/config/default.yml
api:
type: rest # This resource will have RESTful routes
prefix:
resource: "@AppBundle\Controller\ApiController"
name_prefix: api_
apiV2:
type: rest # This resource will have RESTful routes
prefix: /v2
resource: "@AppBundle\Controller\ApiV2Controller"
name_prefix: api_v2_
api_user:
type: rest # This resource will have RESTful routes
prefix:
resource: "@AppBundle\Controller\ApiUserController"
name_prefix: api_
我收到此错误:
处理异常时抛出异常 (Symfony \ Component \ Config \ Exception \ FileLoaderLoadException:该文件 “ /var/www/project/src/AppBundle/Resources/config/default.yml”确实 在中不包含有效的YAML /var/www/project/src/AppBundle/Resources/config/default.yml(其中 从“ /var/www/project/app/config/routing.yml”导入)。 确保有支持“休息”类型的装载机。)
我在哪里错了?我还尝试将FOSRestBundle降级到2.3.1(我读过here),但没有任何变化。
答案 0 :(得分:1)
对于最新版本(> 3.0),您必须将路由类型从“休息”更改为“注释”。
答案 1 :(得分:0)
问题是无效的YAML。以下作品:
numpy==1.15.1
pandas==0.23.4
pyarrow==0.10.0
和
# app/config/routing.yml
api_request_backend:
type: rest
prefix: /api
resource: '@AppBundle/Resources/config/default.yml'
感谢xabbuh进行修复