quick-xml
quick-xml copied to clipboard
Nested Struct and Enum Serialization
This PR fixes issues with nested struct and enum serialization, where the struct name will be serialized multiple times, or enum name will serialized. Unit variant enums are supported as well.
Found a couple more issues with added test cases, will be adjusting this branch more.
This PR fixes the bug I'm seeing with nested struct names getting duplicated, but it leaves in several debugging println! statements that render it unusable until fixed. :-)
(annotation) Start: Fields=[]
(folder) Pending: Fields=[Some("annotation")]```
Does this fix flatten and untagged enums?
EDIT: According to my tests this doesn't seem to fix flatten. What exactly does this fix?
See the test cases added as part of this PR. Without this PR, those test cases will fail.
I no longer am working on the project with the dataset that led to this PR, so would recommend at least bringing in the test cases from this PR, and improving the implementation to make those tests pass. This PR is one possible implementation, but there's probably a better implementation.
Should we maybe still try to merge it? I'm sure I wouldn't be alone to benefit from the serde support working better :) (Currently I'm using this PR, without the prints and merged on master: https://github.com/Ten0/quick-xml but I'd much rather not have to maintain this)
Since merging #490 both problems are fixed:
- struct name no more serialized multiple times
- enum name is not serialized. Type names are no more serialized at all