From 9943cfb137ecf019e06cecbad4af9d2daec3946b Mon Sep 17 00:00:00 2001 From: Fedor Tolstonozhenko Date: Sun, 29 Sep 2024 21:58:23 +0200 Subject: [PATCH] Add xml namespace serialization / deserialization --- crates/opensi-core/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/opensi-core/src/lib.rs b/crates/opensi-core/src/lib.rs index 849545e..310c7cf 100644 --- a/crates/opensi-core/src/lib.rs +++ b/crates/opensi-core/src/lib.rs @@ -36,6 +36,8 @@ pub struct Package { pub logo: Option, #[serde(rename = "@restriction", skip_serializing_if = "Option::is_none")] pub restriction: Option, + #[serde(rename = "@xmlns")] + pub namespace: String, // elements pub info: Info, @@ -367,7 +369,12 @@ pub struct Question { pub scenario: Vec, #[serde(deserialize_with = "unwrap_list", serialize_with = "wrap_answer_list")] pub right: Vec, - #[serde(deserialize_with = "unwrap_option_list", default, serialize_with = "wrap_option_answer_list", skip_serializing_if = "Option::is_none",)] + #[serde( + deserialize_with = "unwrap_option_list", + default, + serialize_with = "wrap_option_answer_list", + skip_serializing_if = "Option::is_none" + )] pub wrong: Option>, #[serde(rename = "@info", skip_serializing_if = "Option::is_none")] pub info: Option,