A type-safe cascading configuration library for Kotlin/Java/Android, supporting most configuration formats
beforeSet
/afterSet
for configbeforeSet
/afterSet
for itembeforeLoad
/afterLoad
for configaction
parameter for Git sourcetcpPort
and tcp_port
in the source are treated as the same key. You can use config.disable(Feature.LOAD_KEYS_AS_LITTLE_CAMEL_CASE)
to disable this change.fromXXX
APIs on providers are removed use the new shorter APIs instead. E.g., you can use file
instead of fromFile
.feature: support flatten env source (#41)
If you have the following environment variables:
DATABASE=foo.example.com
DATABASE_USER=john
DATABASE_PASS=doe
You can load them without any name conversion by using config.from.env(nested=false)
:
object Root : ConfigSpec("") {
val DATABASE by required<String>()
val DATABASE_USER by required<String>()
val DATABASE_PASS by required<String>()
}
Config {
addSpec(Root)
}.from.env(nested=false)
fix: support numeric keys in source
Now you can use numeric keys in source (use YAML as example):
tree:
1:
myVal: true
A serious configuration error in Gradle has been fixed in this version. This bug will cause compilation error when using konf
without simultaneously declaring dependency to konf-core
since v0.15. Please upgrade to this version if you are using v0.15~v0.20.0.
config.toValue<T>()
watchFile
throws exception when using relative pathconfig.disable(Feature.SUBSTITUTE_SOURCE_BEFORE_LOADED)
to disable this change.fromXXX
APIs on providers are deprecated now, use the new shorter APIs instead. E.g., you can use file
instead of fromFile
.