-
-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
💡 Feature description
In config-rs, there's an option to define a separator
which allow users to structure their env vars. I think an example will illustrate better:
#[derive(Deserialize)]
struct Config {
database: Database
}
#[derive(Deserialize)]
struct Database {
name: String,
}
If we define a separator, let's say "__", we could create this Config
by setting DATABASE__NAME=foo
.
Would it be possible and desirable for envy
to include it?
Alternatives
It is possible to get the same behavior using the flatten
attribute from serde (as noticed in #15). The drawback is that it demands a good amount of boilerplate because we would have to serde's rename
every field in the nested struct if we wanted to use this separator idea.
mycognosist, kotx, mortenlj and aesy
Metadata
Metadata
Assignees
Labels
No labels