i have an application.conf file with a structure like the following:
poller {
datacenters = []
}
i would like to override datacenters on the command line. for other configuration keys whose values are simple types (strings, numbers) i can override using -Dpath.to.config.value=<value>
, and this works fine. however, i can't seem to find a way to do this for lists. in the example above, i tried to set datacenters to ["SJC", "IAD"] like so: -Dpoller.datacenters="['SJC', 'IAD']"
, but i get an exception that the key value is a string, not a list. is there a way to signal to the typesafe config library that this value is a list?
I had the same issue some weeks ago, and finally dived into the source code to understand what's going on:
Fixing it wouldn't be that hard, but someone need to take time to do it.
An alternative syntax is implemented in version 1.0.1 for this: