How to add keys to the Symfony configs and solve the "unrecognized option" issue?

I’m working on a Symfony 3.4.6 app, that has a lot of YAML configuration files in the [project root]/config/packages. I added a key to one of them (let’s say xyz.yaml):

xyz:
  ...
  foo:
    bar: 123
    buz: 567

Now I’m getting an error:

In ArrayNode.php line 319:
Unrecognized option "foo" under "xyz"

I took a look into the ArrayNode.php#319. Well, the thing is clear: arbitrary / additional keys are not allowed. There seems to be something like a whitelist. But where is it defined / how to extend it (add the new keys to it)?

How to solve the "unrecognized option" issue by adding keys to Symfony configs?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *