-
-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
🐛 Bug description
With a struct that uses serde's deny_unknown_fields
container attribute using non-prefixed keys envy kind-of correctly fails with the error unknown field an_other_env_variable, expected one of ...
.
Arguably that pragma does not make sense for that case, but might be necessary for other (de)serializations.
🤔 Expected Behavior
It ignores the other environment variables.
👟 Steps to reproduce
use serde::Deserialize;
#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
struct Config {
size: Option<u32>,
}
fn main() {
match envy::from_env::<Config>() {
Ok(config) => println!("provided config.size {:?}", config.size),
Err(err) => println!("error parsing config from env: {}", err),
}
}
envy version: 0.4.1
Metadata
Metadata
Assignees
Labels
No labels