Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.
This repository was archived by the owner on May 6, 2020. It is now read-only.

Does not pass unknown fields properly  #19

@White-Oak

Description

@White-Oak

For xml:

<a>
 <b>
   <c>5<c/>
 <b/>
 <other>
  <d>6<d/>
 <other/>
<a/>

with Rust structures:

#[derive(Deserialize, Debug)]
struct a {
    other: Vec<other>,
}

#[derive(Deserialize, Debug)]
struct other {
    d: i32,
}

serde_xml will fail with error at runtime (Expected text), and it is fixed by declaring an empty struct and adding a field of that type to a atructure a.

#[derive(Deserialize, Debug)]
struct Empty;

#[derive(Deserialize, Debug)]
struct a {
    b: Empty,
    other: Vec<other>,
}

#[derive(Deserialize, Debug)]
struct other {
    d: i32,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions