Changelog - 2026-09-12
Empty env values are allowed by default
BreakingIn one line. validateEnvs() used to throw on the first prefixed env name whose value was empty, and you opted out with ALLOW_EMPTY_ENV_VALUE. The default is now the other way round.
What changed
ALLOW_EMPTY_ENV_VALUE | Behaviour |
|---|---|
| unset | Empty values allowed. This is the default |
blank (ALLOW_EMPTY_ENV_VALUE=) | Reads as unset, so allowed |
false or 0 | Every prefixed key must be non-empty. Boot throws on the first that is not |
| anything else | Allowed |
- Why.
applicationEnvironment.get()now treatsKEY=as missing and falls back todefaultValue(see An Env Read Now Does What It Promises), so the empty value is handled where it is read. - The startup banner reports which way it resolved.
- No declaration needed.
ALLOW_EMPTY_ENV_VALUEandAPPLICATION_ENV_PREFIXare both optional and are read straight offprocess.env. They do not carry theAPP_ENVprefix, so do not add them toEnvironmentKeys; a read throughAppEnvs.get()would answerundefinedforever. Unset, you getAPP_ENVas the prefix and empty values allowed.
Who is affected
- You relied on boot failing when an env value was empty. It no longer does. Set
ALLOW_EMPTY_ENV_VALUE=falseto keep that behaviour. - You already set
ALLOW_EMPTY_ENV_VALUEto something truthy. Nothing changes. You can delete the line. - Everyone else. Nothing. A populated value has always passed.
Breaking changes
WARNING
Anyone who relied on the boot failure over an empty env value.
Before: an empty prefixed value threw at boot unless ALLOW_EMPTY_ENV_VALUE was truthy.
After: empty values pass unless you set:
bash
ALLOW_EMPTY_ENV_VALUE=false