FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony
http://symfony.com/doc/master/bundles/FOSRestBundle/index.html
MIT License
2.79k stars 703 forks source link

What is the proper way to configure FOSRestBundle with Symfony 5? #2241

Closed grzegorztomasiak closed 4 years ago

grzegorztomasiak commented 4 years ago

I put this in routes.yml:

api:
  type: rest
  resource: "routes_api.yml"
  prefix:   /api/v2

and routes_api.yml

my_endpoint:
  path: /my-endpoint
  defaults: { _controller: App:Endpoint:my }
  methods:
    - GET

but I get the error:

Cannot load resource "App\Controller\EndpointController". Make sure there is a loader supporting the "rest" type.

imlokeshs commented 4 years ago

@grzegorztomasiak Could you please help me on this issue to solve...I facing an issue with FOSRestBundle using Symfony 5 framework. I have listed the error below:

Cannot load resource "App\Controller\ListController". Make sure there is a loader supporting the "rest" type.

dcp-dev commented 3 years ago

@grzegorztomasiak Could you please help me on this issue to solve...I facing an issue with FOSRestBundle using Symfony 5 framework. I have listed the error below:

Cannot load resource "App\Controller\ListController". Make sure there is a loader supporting the "rest" type.

Did you manage to resolve this error ? I'm currently encountring the same issue

grzegorztomasiak commented 3 years ago

Checking the project now, and it seems that I just removed rest from there and it works.

api.v1:
  resource: "routes_api.yaml"
  prefix: /api/v2