Skip to content

Commit f91c4c1

Browse files
committed
Error out on any unknown keys in configs
This will make it very obvious during validate if there are any misspelled or unmigrated configuration options. Signed-off-by: Robert Detjens <github@detjens.dev>
1 parent 73ac1ce commit f91c4c1

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/configparser/challenge.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ pub fn parse_one(path: &PathBuf) -> Result<ChallengeConfig> {
118118

119119
#[serde_nested]
120120
#[derive(Debug, PartialEq, Serialize, Deserialize)]
121+
#[serde(deny_unknown_fields)]
121122
#[fully_pub]
122123
pub struct ChallengeConfig {
123124
name: String,

src/configparser/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ pub fn parse() -> Result<RcdsConfig> {
4848
//
4949

5050
#[derive(Debug, PartialEq, Serialize, Deserialize)]
51+
#[serde(deny_unknown_fields)]
5152
#[fully_pub]
5253
struct RcdsConfig {
5354
flag_regex: String,

0 commit comments

Comments
 (0)