Fix couple of bugs in serde deserializer#523
Merged
Mingun merged 5 commits intotafia:masterfrom Dec 12, 2022
Merged
Conversation
failures (2):
struct_::excess_data_before::cdata
struct_::excess_data_before::text_non_spaces
…uctures in serde deserializer, like ```xml unwanted text<struct>...</struct> ```
…ibes the purpose of method
Mingun
commented
Dec 11, 2022
Comment on lines
+315
to
+316
| // Comment to prevent auto-formatting | ||
| e.decode(true)?, |
Collaborator
Author
There was a problem hiding this comment.
I keep this formatting because it highly likely that I'll replace e.decode() with more complicated expression in #521
Codecov Report
@@ Coverage Diff @@
## master #523 +/- ##
==========================================
+ Coverage 61.70% 61.77% +0.07%
==========================================
Files 33 33
Lines 15466 15425 -41
==========================================
- Hits 9543 9529 -14
+ Misses 5923 5896 -27
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Collaborator
|
IMO we should probably push a release after this |
Collaborator
Author
|
I hope I finish #521 this year and cut a release after that |
dralley
reviewed
Dec 12, 2022
Changelog.md
Outdated
| ```xml | ||
| unwanted text<struct>...</struct> | ||
| ``` | ||
| - [#523]: Fix incorrect handling of `xs:list`s with encoded spaces: their are still |
Collaborator
There was a problem hiding this comment.
Did you mean "they still act as delimiters"?
dralley
approved these changes
Dec 12, 2022
…act as delimiters Co-authored-by: Daniel Alley <[email protected]>
…iptive name to a struct
crapStone
added a commit
to Calciumdibromid/CaBr2
that referenced
this pull request
Dec 29, 2022
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [quick-xml](https://github.com/tafia/quick-xml) | dependencies | minor | `0.26.0` -> `0.27.1` | --- ### Release Notes <details> <summary>tafia/quick-xml</summary> ### [`v0.27.1`](https://github.com/tafia/quick-xml/blob/HEAD/Changelog.md#​0271----2022-12-28) [Compare Source](tafia/quick-xml@v0.27.0...v0.27.1) ##### Bug Fixes - [#​530]: Fix an infinite loop leading to unbounded memory consumption that occurs when skipping events on malformed XML with the `overlapped-lists` feature active. - [#​530]: Fix an error in the `Deserializer::read_to_end` when `overlapped-lists` feature is active and malformed XML is parsed [#​530]: tafia/quick-xml#530 ### [`v0.27.0`](https://github.com/tafia/quick-xml/blob/HEAD/Changelog.md#​0270----2022-12-25) [Compare Source](tafia/quick-xml@v0.26.0...v0.27.0) ##### New Features - [#​521]: Implement `Clone` for all error types. This required changing `Error::Io` to contain `Arc<std::io::Error>` instead of `std::io::Error` since `std::io::Error` does not implement `Clone`. ##### Bug Fixes - [#​490]: Ensure that serialization of map keys always produces valid XML names. In particular, that means that maps with numeric and numeric-like keys (for example, `"42"`) no longer can be serialized because [XML name] cannot start from a digit - [#​500]: Fix deserialization of top-level sequences of enums, like ```xml <?xml version="1.0" encoding="UTF-8"?> <!-- list of enum Enum { A, B, С } --> <A/> <B/> <C/> ``` - [#​514]: Fix wrong reporting `Error::EndEventMismatch` after disabling and enabling `.check_end_names` - [#​517]: Fix swapped codes for `\r` and `\n` characters when escaping them - [#​523]: Fix incorrect skipping text and CDATA content before any map-like structures in serde deserializer, like ```xml unwanted text<struct>...</struct> ``` - [#​523]: Fix incorrect handling of `xs:list`s with encoded spaces: they still act as delimiters, which is confirmed also by mature XmlBeans Java library - [#​473]: Fix a hidden requirement to enable serde's `derive` feature to get quick-xml's `serialize` feature for `edition = 2021` or `resolver = 2` crates ##### Misc Changes - [#​490]: Removed `$unflatten=` special prefix for fields for serde (de)serializer, because: - it is useless for deserializer - serializer was rewritten and does not require it anymore This prefix allowed you to serialize struct field as an XML element and now replaced by a more thoughtful system explicitly indicating that a field should be serialized as an attribute by prepending `@` character to its name - [#​490]: Removed `$primitive=` prefix. That prefix allowed you to serialize struct field as an attribute instead of an element and now replaced by a more thoughtful system explicitly indicating that a field should be serialized as an attribute by prepending `@` character to its name - [#​490]: In addition to the `$value` special name for a field a new `$text` special name was added: - `$text` is used if you want to map field to text content only. No markup is expected (but text can represent a list as defined by `xs:list` type) - `$value` is used if you want to map elements with different names to one field, that should be represented either by an `enum`, or by sequence of `enum`s (`Vec`, tuple, etc.), or by string. Use it when you want to map field to any content of the field, text or markup Refer to [documentation] for details. - [#​521]: MSRV bumped to 1.52. - [#​473]: `serde` feature that used to make some types serializable, renamed to `serde-types` - [#​528]: Added documentation for XML to `serde` mapping [#​473]: tafia/quick-xml#473 [#​490]: tafia/quick-xml#490 [#​500]: tafia/quick-xml#500 [#​514]: tafia/quick-xml#514 [#​517]: tafia/quick-xml#517 [#​521]: tafia/quick-xml#521 [#​523]: tafia/quick-xml#523 [#​528]: tafia/quick-xml#528 [XML name]: https://www.w3.org/TR/xml11/#NT-Name [documentation]: https://docs.rs/quick-xml/0.27.0/quick_xml/de/index.html#difference-between-text-and-value-special-names </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43My4wIiwidXBkYXRlZEluVmVyIjoiMzQuNzQuMiJ9--> Co-authored-by: cabr2-bot <[email protected]> Co-authored-by: crapStone <[email protected]> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1692 Reviewed-by: crapStone <[email protected]> Co-authored-by: Calciumdibromid Bot <[email protected]> Co-committed-by: Calciumdibromid Bot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes two bugs in serde deserializer that I found during work on #521:
structs. This should not happenxs:list. That means, that you cannot encode spaces inxs:listelements using entity references and -- that escape sequences should be threated as list delimiters. The Java's mature XmlBeans library confirm that.