Ktor loads automatically the configs from HOCON an...
# ktor
n
Ktor loads automatically the configs from HOCON and other sources doing some simple type checking (to my understanding) on the values. As the ktor system offers schema out of the box, checking that won't be needed, but what about the sanity of the values, or if there are some optional or mutually exclusive settings? What are your conventions and battle testes strategies for the config values themselves? E.g. • having a JDBC connection URL, how do you (or do you) check the format and sanity of the URL, or for example just let the connection (pool) init fail and throw an exception when the driver cannot use the URL? • Or another setting with a file path to an account credentials file (Google Play Store, Firebase etc): do you verify the sanity of the path or existence or file type/contents (must be JSON with fields X, Y, Z and so forth) of the file, or, yet again, just let the runtime exception be thrown from where the file is attempted to be loaded first time? • Having distinct behaviour in a feature based on the presence of a sub-config or another, how do you check the mutually exclusion