You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Properly use xsi:nil to deserialize null values via serde
This commit fixes an issue that causes `quick-xml` trying to deserialize
empty tags via the serde interface even if these tags were explicitly
marked as `xsi:nil="true"`
For example the following XML failed to deserialize before this commit:
```xml
<bar>
<foo xsi:nil="true"/>
</bar>
```
into the following rust type:
```rust
#[derive(Deserialize)]
struct Bar {
foo: Option<Inner>,
}
#[derive(Deserialize)]
struct Foo {
baz: String,
}
```
Before this commit this failed to deserialize with an error message that
complained that the `baz` field was missing. After this commit this uses
the `xsi:nil` attribute to deserialize this into `foo: None` instead.
The standard (https://www.w3.org/TR/xmlschema-1/#xsi_nil) seems to
support this behaviour.
Fix#497
0 commit comments