Support for environment variables with square brackets #5315
Labels
theme: config-data
Issues related to the configuration theme
type: enhancement
A general enhancement
Milestone
The ability to define keys in an array format like
service.server[0]=http://server1
is is great when used in conjunction with@ConfigurationProperties
.Unfortunately the square brackets are considered special characters for environment variable names.
-e
flag to defineSERVICE_SERVER[0]=http://server1
and it worksexport
likeexport SERVICE_SERVER[0]=http://server1
I get anot a valid identifier
error[A-Za-z_][A-Za-z0-9_]*
. There is a related discussion about dashes vs underscores Cannot use dash in environment variable names in a pod definition kubernetes/kubernetes#16863I chatted with @philwebb yesterday about this issue. While I can find other ways to pass those values to the application, i.e.: use an environment variable to define application args and let the entrypoint in Docker take care of it; it would be great if Spring could handle that out-of-the-box. One idea I discussed with Phil is to use double
_
around the index likeSERVICE_SERVER__0__
.The text was updated successfully, but these errors were encountered: