pureconfig
pureconfig copied to clipboard
Allow custom ConfigParseOptions
Currently there is no way to specify custom ConfigParseOptions in order to configure the parsing of config files. For example, it is impossible to set allowMissing to false
. The default value for allowMissing
is true
, therefore an application does not fail in case of a missing included config file.
It would be convenient to set custom ConfigParseOptions before loading the Config object:
val parseOptions = ConfigParseOptions.defaults()
.setAllowMissing(false)
val config: T = ConfigSource.default
.at(namespace)
.parseOptions(parseOptions)
.loadOrThrow[T]