-
-
Notifications
You must be signed in to change notification settings - Fork 862
Closed
Closed
Copy link
Description
Hello,
Since I upgraded the serde crate from version 1.0.219 to 1.0.224, the #[serde(untagged)] attribute no longer works.
When I try to deserialize this:
#[derive(Debug, Deserialize, Serialize, Clone, Encode, Decode)]
#[serde(untagged)]
pub enum ConditionValueTypeConfig {
Single(ConditionValueConfig),
Multiple(Vec<ConditionValueConfig>),
}
#[derive(Debug, Deserialize, Serialize, Clone, Encode, Decode)]
pub enum ConditionValueConfig {
String(String),
Integer(i64),
Decimal(f64),
HttpMethod(HttpMethodConfig),
HttpContentType(ContentTypeConfig),
HttpStatus(u32),
}
I want to deserialize a RON text like this:
Condition(Method,Eq,HttpMethod(Any))
With serde version 1.0.219 :
OK
With serde version 1.0.220 :
'./conf.ron': 95:99-95:100: data did not match any variant of untagged enum ConditionValueTypeConfig")
With serde version 1.0.224 :
./conf.ron': 95:99-95:100: data did not match any variant of untagged enum ConditionValueTypeConfig")
So the bug has appeared since version 1.0.220
Now have to pin the old version in Cargo.toml.
serde = { version = "=1.0.219", features = ["derive"] }
Thank you in advance for your help.
Metadata
Metadata
Assignees
Labels
No labels