-
Notifications
You must be signed in to change notification settings - Fork 277
Closed
Description
Thanks for your effort. It is awesome that using serde to serialize or deserialize the xml.
There are some differences in serializing enum type between the output in quick_xml and that in serde_json.
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
enum Type {
Foo,
Bar,
}
#[derive(Serialize, Deserialize, Debug)]
struct A {
pub member: Type
}
fn main() {
let data = A {member: Type::Foo};
let json_result = serde_json::to_string(&data).unwrap();
println!("{:?}", json_result);
let xml_result = quick_xml::se::to_string(&data).unwrap();
println!("{:?}", xml_result);
}The output of this code is
"{\"member\":\"Foo\"}"
"<A><Foo/></A>"
Is this result is expected? I think it should be
"<A member="Foo"><A/>"Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels