I have a problem with Symfony2 creating Rest API and usingFOS\RestBundle
When I try to create a database or entity ... No matter what I try to generate, an error occurs.
root@symfonyRest:/var/www/Symfony
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized options "prefer_extension" under "fos_rest.format_listener"
The problem seems to be config.yml
config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
framework:
secret: %secret%
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
templating:
engines: ['twig']
[…]
sensio_framework_extra:
view: { annotations: false }
router: { annotations: true }
fos_rest:
format_listener:
prefer_extension: false
view:
view_response_listener: true
EDIT:
new config.yml with format_listener.rules
fos_rest:
view:
view_response_listener: true
format_listener:
rules:
prefer_extension: false
But I also have a mistake.
[Symfony\Component\Config\Definition\Exception\InvalidTypeException]
Invalid type for path "fos_rest.format_listener.rules.prefer_extension". Ex
pected array, but got boolean
Anyone have a solution to my problem? Thanks!
source
share