Fix #257 and allow $text to work with tags in the text #511
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 is a very early attempt at solving #257 (awful, but functional, code below). Unfortunately, I ran into a design issue so I'd like to open the discussion now and get your feedback on what to do.
Suppose we have the following struct to deserialize (from the test case attached in serde-de.rs below)
The test case has the following xml
deserialize into
The test case also assumes the xml
should not deserialize (missing field
$text
)However, if we change the design for how $text works to include embedded tags, this would now be deserializable where 'outer' is the root tag and everything between can now be fed into a text field because root can be part of the string now.
Outside of the above being newly expected behavior we could make the user describe which tags can be deserialized into text fields instead of read:
Let me know if you have any other ideas on what would be best to do here.