pureconfig icon indicating copy to clipboard operation
pureconfig copied to clipboard

Allow custom ConfigParseOptions

Open tashoyan opened this issue 2 years ago • 0 comments

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]

tashoyan avatar Dec 28 '22 16:12 tashoyan