Closed
Description
Symfony version(s) affected: 5.2.6
Description
I cannot parse an environment variable into an array.
How to reproduce
# env
TRUSTED_HOSTS="[\"10.0.0.1\", \"10.0.0.2\"]"
# config/packages/framework.yaml
framework:
trusted_hosts: '%env(json:TRUSTED_HOSTS)%'
I get:
Invalid type for path “framework.trusted_hosts.0”. Expected one of “bool”, “int”, “float”, “string”, but got “array”.
See reproducer repo: https://github.com/Nyholm/sf-issue-40906