You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def getStringSeq(path: String): Seq[String] = {
underlying.getValue(path).valueType match {
case LIST => underlying.getStringList(path).asScala
case STRING =>
val value = underlying.getString(path)
arrayCircumfix.lift(value).map(_.split(",").map(_.trim).toSeq).getOrElse {
sys.error(s"Unable to read value $path, invalid array: $value")
}
case tpe => sys.error(s"Unable to read value $path, type $tpe not supported")
}
}
To being able to pass "-Dkey=[a,b,c]" as system properties and got it correctly in the app.
There is a weird dichotomy between how value are read form file vs system properties... I tried to fix in source but I was very confuse so I did this hack.
That would be great if you can fix this as it's very useful feature.
The text was updated successfully, but these errors were encountered:
See #69 for past discussion/fix. We did the somewhat clunky -Dkey.0=a -Dkey.1=b to avoid any escaping/quoting, for reasons discussed on that issue.
In general and when possible I think it's better to create a file like "myserver.conf" and do -Dconfig.file=myserver.conf instead of using command line for complex properties.
The dichotomy is not really weird I don't think, though it may not be obvious... properties have Java properties syntax and .conf files have HOCON (or JSON, it's a superset) syntax. Properties syntax does not have lists, only strings. We support some JSON stuff (boolean, number) from properties by offering an automatic conversion from string to boolean/number, but there are a lot more hard questions that arise if you try to implicitly convert from types with syntax (such as object and list). Those conversions would likely create bugs, surprising behavior, and confusing error messages.
We had to pimp Config and add this:
To being able to pass "-Dkey=[a,b,c]" as system properties and got it correctly in the app.
There is a weird dichotomy between how value are read form file vs system properties... I tried to fix in source but I was very confuse so I did this hack.
That would be great if you can fix this as it's very useful feature.
The text was updated successfully, but these errors were encountered: