-
Notifications
You must be signed in to change notification settings - Fork 32
Nested data structs are not resolved as expected #55
Copy link
Copy link
Open
Description
An OTP app config with nested data structs evaluates to nil if at least one entry specifies system env var that is not set.
Example:
config :my_app,
var: [
foo: {:system, :string, "FOO"},
bar: "bar-value"
]
Expected:
iex> Confex.get_env(:my_app, :var)
[
foo: nil,
bar: "bar-value"
]
Less expected, but still meaningful:
iex> Confex.get_env(:my_app, :var)
[
bar: "bar-value"
]
Actual:
iex> Confex.get_env(:my_app, :var)
nil
Workaround:
Use 4 element tuple with a default value of nil
config :my_app,
var: [
foo: {:system, :string, "FOO", nil},
bar: "bar-value"
]
####
iex> Confex.get_env(:my_app, :var)
[
foo: nil,
bar: "bar-value"
]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels