-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
.kebabCase
is not working for array in hocon config
#1095
Comments
.kebabCase
is not working for custom configs.kebabCase
is not working for array in hocon config
zioConfigVersion = "4.0.0-RC10" |
@bilal-fazlani I will take a look. There are some ongoing work back in ZIO to handle a few cases. |
Thanks! |
To unblock yourself during the RC versions, you can use the standard methods in zio-config such as mapKey import zio.config._
CombinedArrayValue.config.mapKey(toKebabCase)) // and avoid .kebabCase in the provider Solution to this inconsistency is on it's way!With zio/zio#7823 (merged earlier, but we couldn't use it yet) and zio/zio#7891 (merged recently), zio-config can now depend on latest ZIO to allow your original code to work |
@afsalthaj is this available in a published zio and zio-config version? The below is failing for me with error
case class Settings(
anArray: List[String]
)
object Settings {
val config: Config[Settings] =
(deriveConfig[Settings]).nested("settings")
}
object TestMain extends ZIOAppDefault {
override val bootstrap: ZLayer[ZIOAppArgs, Any, Any] =
Runtime.setConfigProvider(configProvider)
lazy val configProvider = TypesafeConfigProvider
.fromHoconString(s"""
|settings={
| an-array = ["a", "b", "c"]
|}
""".stripMargin)
.kebabCase
def run = for {
c <- ZIO.config(Settings.config)
_ <- Console.printLine(c.toString)
} yield ()
} I am using val zioVersion = "2.0.10"
val zioConfigVersion = "4.0.0-RC14" |
Output:
If I remove the
.kebabCase
call, it works.Output after removing
.kebabCase
The text was updated successfully, but these errors were encountered: