You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried adding a key in that json that has underscores in it { "like_this": "blabla" }. I expected it to be overwritten by an env varible like APP_LIKE_THIS but that doesn't work.
Is this a bug or am I doing something wrong?
The text was updated successfully, but these errors were encountered:
@brizental This behavior was changed in 0.9. Env variables match with underscores by default as you would expect. If you want nesting behavior you need to now opt-in to it.
// `APP_FOO_BAR` will match `foo_bar`Environment::with_prefix("APP");// `APP_FOO_BAR` will match `foo.bar` (nested struct)// This was the default behavior in 0.8Environment::with_prefix("APP").separator("_");// `APP_FOO__BAR_BAZ` will match `foo.bar_baz` (nested struct)Environment::with_prefix("APP").separator("__");
So, I have a
default.json
that I can overwrite using my custom prefixed env variables (just like https://github.com/mehcode/config-rs/blob/master/examples/hierarchical-env/src/settings.rs#L58).I tried adding a key in that json that has underscores in it
{ "like_this": "blabla" }
. I expected it to be overwritten by an env varible likeAPP_LIKE_THIS
but that doesn't work.Is this a bug or am I doing something wrong?
The text was updated successfully, but these errors were encountered: