I am trying to parse simple UML models using yaserde 0.7.1.
The associated xml files strongly rely on element inheritance to avoid duplication. For example, most elements have xmi:type, xmi:id and name attributes, but it cannot be modeled out of the box in Rust.
My first quick and dirty prototype duplicated all such attributes in every structure definition. This worked, but I felt it would quickly become a problem as I progressed further.
This lead me to yaserde flatten feature, which seemed very promizing. Sadly, my current tests show it is working as intended when serializing, but the flattened attributes are ignored when deserializing.
Maybe there is something I do not understand?
I have attached a complete test case demonstrating the issue.
Hello,
I am trying to parse simple UML models using
yaserde
0.7.1.The associated xml files strongly rely on element inheritance to avoid duplication. For example, most elements have
xmi:type
,xmi:id
andname
attributes, but it cannot be modeled out of the box in Rust.My first quick and dirty prototype duplicated all such attributes in every structure definition. This worked, but I felt it would quickly become a problem as I progressed further.
This lead me to
yaserde
flatten feature, which seemed very promizing. Sadly, my current tests show it is working as intended when serializing, but the flattened attributes are ignored when deserializing.Maybe there is something I do not understand?
I have attached a complete test case demonstrating the issue.
github-sample.zip
Just unzip this archive somewhere and run
cargo test
in the crate root