-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] allow to override default name for environment variables #96
Comments
I'm not quite sure I follow the question. Can you give a concrete example of what you're doing now, what doesn't work with it, and what you'd like to do? Alternatively, consider looking at https://serde.rs/field-attrs.html. Maybe |
Hey sure I'll try. The config I use is looking something like host = "localhost"
port = 9000
[remote-service]
api_key = "dev-key"
... #[derive(Debug, Deserialize, Clone)]
struct Config {
host: String,
port: u16,
remote_service: RemoteServiceConfig,
}
#[derive(Debug, Deserialize, Clone)]
struct RemoteService {
api_key: String
} in production the environment variable to set/override is Is there a way (that I don't know) to set the name of the environment variable to deserialize the nested |
I hope this is a bit clearer |
I finally got around to testing the serde route and it worked - would you mind me adding a bit of documentation to help future users of the library (a.k.a. me in a month). |
Sure! What specifically might have helped you? |
I am writing an application copying an existing webservice, to stay sane I am structuring the config for my copy differently than the original service.
Most of the config I get from a toml file, but when I want to ship this to production I have to get api keys from environment variables that don't match the nested structure imposed by figment.
Is there a way to override the default (structured) names for environment variables like in this example taken from the envconfig crate
The text was updated successfully, but these errors were encountered: