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

Add support for XML Schema xs:list type #395

Merged
merged 6 commits into from Jun 20, 2022
Merged

Conversation

Mingun
Copy link
Collaborator

@Mingun Mingun commented Jun 5, 2022

This PR allows deserializing Vec and other sequences from space-separated lists, as defined by XML Schema specification. So now this is possible:
Deserialize

struct AnyName {
  // Will contain vec!["first", "second", "third"]
  attribute: Vec<String>,
}

from

<any-tag attribute="first second third">

@Mingun Mingun added enhancement serde Issues related to mapping from Rust types to XML labels Jun 5, 2022
@Mingun Mingun requested a review from dralley June 5, 2022 17:15
@codecov-commenter
Copy link

Codecov Report

Merging #395 (328b4f6) into master (0a42987) will increase coverage by 1.71%.
The diff coverage is 86.05%.

@@            Coverage Diff             @@
##           master     #395      +/-   ##
==========================================
+ Coverage   60.79%   62.50%   +1.71%     
==========================================
  Files          19       20       +1     
  Lines        9843    10664     +821     
==========================================
+ Hits         5984     6666     +682     
- Misses       3859     3998     +139     
Flag Coverage Δ
unittests 62.50% <86.05%> (+1.71%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/errors.rs 12.50% <0.00%> (-0.41%) ⬇️
src/events/mod.rs 73.87% <ø> (ø)
src/de/map.rs 72.85% <51.16%> (-15.90%) ⬇️
src/de/simple_type.rs 90.13% <90.13%> (ø)
src/de/mod.rs 78.07% <100.00%> (+1.99%) ⬆️
src/reader.rs 88.10% <100.00%> (-0.12%) ⬇️
src/de/escape.rs 23.35% <0.00%> (-43.07%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0a42987...328b4f6. Read the comment docs.

@Mingun Mingun force-pushed the xs-list branch 2 times, most recently from 47689e4 to 8d5215a Compare June 13, 2022 16:13
@dralley dralley removed their request for review June 20, 2022 04:39
src/de/simple_type.rs Outdated Show resolved Hide resolved
src/de/simple_type.rs Outdated Show resolved Hide resolved
@dralley
Copy link
Collaborator

dralley commented Jun 20, 2022

I tried to do a code review on this PR but since I don't use quick-xml via serde, am not familiar with Serde's parsing, etc. I realized I don't have time to do all of that research, plus dig through the XML spec, plus review the PR, and keep everything in my head long enough to get it done.

So I have just given this a brief look through. You've done a great job with the testing

@dralley
Copy link
Collaborator

dralley commented Jun 20, 2022

Feel free to merge this without a full approval

Mingun and others added 4 commits June 21, 2022 00:42
failures (8):
    seq::fixed_name::fixed_size::xs_list::many
    seq::fixed_name::fixed_size::xs_list::one
    seq::fixed_name::variable_size::xs_list::many
    seq::fixed_name::variable_size::xs_list::one
    seq::variable_name::fixed_size::xs_list::many
    seq::variable_name::fixed_size::xs_list::one
    seq::variable_name::variable_size::xs_list::many
    seq::variable_name::variable_size::xs_list::one
@Mingun Mingun merged commit 038bfed into tafia:master Jun 20, 2022
@Mingun Mingun deleted the xs-list branch June 20, 2022 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 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

3 participants