Skip to content

Capture other unrecognized fields #941

Closed
@dtolnay

Description

@dtolnay
#[derive(Serialize, Deserialize)]
struct S {
    a: u32,
    b: String,
    #[serde(other)]
    other: Map<String, Value>,
}
{"a":0,"b":"","c":true}

This would deserialize into other containing "c" => true.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions