-
Notifications
You must be signed in to change notification settings - Fork 235
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
Serde support needs to be revisited #185
Comments
Thank you for your issue, your PR and the time you have spent on it! Serde is a hard topic, in particular for xmls. I agree the current state is not ideal and I am very open to revisit it. Before merging it, I already had many attempts. I recognize this is not perfect but it gets the job done for a lot of situations so I decided to release it. Also sorry for the late answer, I really appreciate the time you have spent on it. Regarding the PR, I have started to review it but there are several things I need to get done before. Also I think we could easily split it into several PR if possible because you add lot of new implementations, some rather trivial some more complicated. |
I'm checking out this crate as an alternative to
I'm parsing all not captured tags values in a HashMap like this: use serde_json::Value;
pub struct MyItem {
pub id: i32,
// ... Some more values here
#[serde(flatten)]
pub unknown: HashMap<String, Value>,
} So this will deserialize all the tags in there respective values, and everything else in But now I'm looking at the output and it does not save the values from the body of the tag. (even when I add the example output:
Or at least the value should be there somehow, like this for example:
|
PR #183 fixes some of this behavior with the existing interactions of serde and reader, but overall, the implementation needs to be revisited.
Here's the issues I've encountered so far
rename
attribute will fail to deserialize unless the rename is$value
flatten
attribute does not work$value
will fail to deserializeI've been trying to make things work "better" in my PR, but the rest of these issues would take a significant overhaul of the code.
The text was updated successfully, but these errors were encountered: