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 702 forks source link

Invalid configuration for path "fos_rest.routing_loader": only "false" is supported #2367

Open martinszeltins opened 2 years ago

martinszeltins commented 2 years ago

I am getting this error with the default configuration.

Invalid configuration for path "fos_rest.routing_loader": only "false" is supported

fos_rest:
    param_fetcher_listener:  true
    allowed_methods_listener:  true
    routing_loader: true
    view:
        view_response_listener:  true
    format_listener:
        rules:
            - { path: ^/api, prefer_extension: true, fallback_format: json, priorities: [ json, html ] }

I am using Symfony 6.0 and friendsofsymfony/rest-bundle 3.3

W0rma commented 2 years ago

Have you already checked https://github.com/FriendsOfSymfony/FOSRestBundle/blob/3.x/UPGRADING-3.0.md#upgrading-from-2x-to-30? Seems like the very first entry on this page is about your reported error.

Sajito commented 1 year ago

I think the main issue here is that having routing_loader set to true is part of the symfony flex recipe (https://github.com/symfony/recipes-contrib/tree/main/friendsofsymfony/rest-bundle/2.2), even though it's undocumented. Since the documentation does not contain any information about that settings, it's pretty hard to understand the issue.

I don't think people tend to look into the UPGRADING steps, after doing a clean install of this bundle directly using version >3.

W0rma commented 1 year ago

@Sajito See https://github.com/symfony/recipes-contrib/pull/1493 for adjusting the recipe