Skip to content
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

Nested Struct and Enum Serialization #183

Closed
wants to merge 3 commits into from
Closed

Conversation

dbcfd
Copy link

@dbcfd dbcfd commented Jan 5, 2020

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.

@dbcfd
Copy link
Author

dbcfd commented Jan 6, 2020

Found a couple more issues with added test cases, will be adjusting this branch more.

@dave-andersen
Copy link

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")]```

@Ten0
Copy link

Ten0 commented Mar 31, 2020

Does this fix flatten and untagged enums?

EDIT: According to my tests this doesn't seem to fix flatten. What exactly does this fix?

@dbcfd
Copy link
Author

dbcfd commented Apr 2, 2020

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.

@Ten0
Copy link

Ten0 commented Apr 2, 2020

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)

@Mingun Mingun added bug serde Issues related to mapping from Rust types to XML labels May 21, 2022
@Mingun
Copy link
Collaborator

Mingun commented Oct 29, 2022

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

@Mingun Mingun closed this Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug serde Issues related to mapping from Rust types to XML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants