Skip to content

Commit

Permalink
Extend the test with an always existing condition
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbb committed Jan 23, 2024
1 parent c09f33b commit b2afd76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion serde_with/tests/schemars_0_8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,16 @@ fn schemars_custom_with() {
#[serde_as(as = "DisplayFromStr")]
#[cfg_attr(any(), schemars(with = "i32"))]
with_disabled: i32,

#[serde_as(as = "DisplayFromStr")]
#[cfg_attr(all(), schemars(with = "i32"))]
always_enabled: i32,
}

check_matches_schema::<Test>(&json!({
"custom": 5,
"custom": 3,
"with_disabled": "5",
"always_enabled": 7,
}));
}

Expand Down

0 comments on commit b2afd76

Please sign in to comment.