Repository navigation
|
Hey, I'm trying to detect typos in env variables used to set the config values in my program. I understand that providers don't know the expected keys (they're just providing a dict), the magic happens in One (awkward) idea is to deserialize to json, and then walk the json to generate the (flat) list of keys. Is there a more direct way? |
Answered by
joshka
Sep 10, 2024
Replies: 1 comment 2 replies
|
Try let figment = Figment::from(Serialized::defaults(MyConfig::default()));
dbg!(&figment.data()?[figment.profile()]); // or iterate over the keys here |
2 replies
Answer selected by
nitnelave
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try