Config4k has no option to use different names between code and config file.
data class Person(val name: String, val age: Int)
val config =
ConfigFactory.parseString(
"""
|key {
| name = "foo"
| age = 20
|}"""
.trimMargin(),
)
val person: Person = config.extract("key")
println(person.name) // foo
println(person.age) // 20