vdf-rs icon indicating copy to clipboard operation
vdf-rs copied to clipboard

#[serde(flatten)] crashes when trying to serialize

Open maxomatic458 opened this issue 5 months ago • 6 comments

#[serde(rename = "AppState")]
struct AppManifestFile {
    #[serde(rename = "appid")]
    pub app_id: String,
    pub name: String,
    #[serde(rename = "AutoUpdateBehavior")]
    pub auto_update_bahavior: String,
    #[serde(flatten)]
    other: HashMap<String, Value>,
}

deserializing works.

but when converting this object back to a string, it panics with this message: Expected key, found: Some(ObjBegin)

maxomatic458 avatar Feb 10 '24 23:02 maxomatic458