-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nesting Field doesn't deserialize correctly #192
Comments
and the reason here is in expanded rust impl ::yaserde::YaDeserialize for Sequence {
#[allow(unused_variables)]
fn deserialize<R: ::std::io::Read>(
// ...
match event {
::yaserde::__xml::reader::XmlEvent::StartElement {
ref name,
ref attributes,
..
} => {
if depth == 0 && name.local_name == "xs:sequence" {
let event = reader.next_event()?;
} else {
let namespace = name.namespace.clone().unwrap_or_default();
match (namespace.as_str(), name.local_name.as_str()) {
("http://www.w3.org/2001/XMLSchema", "annotation") => {
if depth == 0 {
let _root = reader.next_event();
}
if let Ok(
::yaserde::__xml::reader::XmlEvent::StartElement { .. },
) = reader.peek()
{
let value = <Annotation as ::yaserde::YaDeserialize>::deserialize(
reader,
)?;
__annotation_value = ::std::option::Option::Some(value);
let _event = reader.next_event()?;
}
}
// ... The way we check
is not correct while name.local_name is "sequence", it didn't match this root check condition but hit the children deserialize ("http://www.w3.org/2001/XMLSchema", "sequence") => {
if depth == 0 {
let _root = reader.next_event();
}
if let Ok(
::yaserde::__xml::reader::XmlEvent::StartElement { .. },
) = reader.peek()
{
let value = <Sequence as ::yaserde::YaDeserialize>::deserialize(
reader,
)?;
__sequences_value.push(value);
let _event = reader.next_event()?;
}
} |
lessu
added a commit
to lessu/yaserde
that referenced
this issue
Sep 16, 2024
issue media-io#192 Signed-off-by: limingyi <lessu@163.com>
MarcAntoine-Arnaud
pushed a commit
that referenced
this issue
Sep 16, 2024
issue #192 Signed-off-by: limingyi <lessu@163.com>
Merged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had a structure like this (xsd standard)
Sequence is nesting.
when parsing format like this
The result is not correct
The text was updated successfully, but these errors were encountered: