I have tried to read empty string env var to HOCON conf but getting weird """" when I read it. Tried to read the official doc and tried different variations such as not setting env var at all but could not come to solution.
I am setting env var in .env file as
export SUPPORTED_VALUES=""
and HOCON configuration as given below
{
feature:
supported-values: ${?SUPPORTED_VALUES}
}
when I read this from Ktor HOCON parser, it reads as """" instead of "". I tried by giving no value to env var but then it is read as "null"
private val supportedValues = appConfig.property("feature.supported-values").getString()
The problem is that the environment variable contains the literal value
""( you can check it out by callingSystem.getenv()["SUPPORTED_VALUES"]). To solve your problem leave the value empty: