Skip to content

Given config now fully validated at wrapper construction

Compare
Choose a tag to compare
@carueda carueda released this 08 Aug 19:38

Resolves #49 (which also supersedes #36).

For both java and scala, in case of any missing or incompatible types in the given configuration, wrapper construction will now throw a com.typesafe.config.ConfigException with a summary of all the corresponding com.typesafe.config.ConfigException's collected as the constructor traverses the configuration.

Example of such a summary:

Invalid configuration:
    'service.poolSize': com.typesafe.config.ConfigException$Missing(No configuration setting found for key 'poolSize')
    'service.url': com.typesafe.config.ConfigException$Missing(No configuration setting found for key 'url')      
    'service.debug': com.typesafe.config.ConfigException$WrongType(String: 5: debug has type NUMBER rather than BOOLEAN)
    'service.doLog': com.typesafe.config.ConfigException$WrongType(String: 6: doLog has type STRING rather than BOOLEAN)
    'service.factor': com.typesafe.config.ConfigException$WrongType(String: 7: factor has type BOOLEAN rather than NUMBER)

(Note: command-line option --scala:fp is now obsolete, still accepted but ignored.)