xso: Add support for serde_json::Value

Maxime “pep” Buquet created

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>

Change summary

xso/Cargo.toml  | 1 +
xso/ChangeLog   | 2 ++
xso/src/text.rs | 3 +++
3 files changed, 6 insertions(+)

Detailed changes

xso/Cargo.toml 🔗

@@ -24,6 +24,7 @@ xso_proc = { version = "0.1", path = "../xso-proc", optional = true }
 jid = { version = "0.12", path = "../jid", optional = true }
 uuid = { version = "1", optional = true }
 base64 = { version = "0.22", optional = true }
+serde_json = { version = "1.0", optional = true, default-features = false, features = ["alloc"] }
 
 [features]
 default = [ "std" ]

xso/ChangeLog 🔗

@@ -38,6 +38,8 @@ Version NEXT:
         for debug logs.
       - Support to selectively discard attributes or text content during
         parsing (!552).
+      - Implement `AsXml` and `FromXml` for serde_json::Value` behind
+        `serde_json` feature.
     * Changes
       - Generated AsXml iterator and FromXml builder types are now
         doc(hidden), to not clutter hand-written documentation with auto

xso/src/text.rs 🔗

@@ -128,6 +128,9 @@ convert_via_fromstr_and_display! {
     jid::DomainPart,
     #[cfg(feature = "jid")]
     jid::ResourcePart,
+
+    #[cfg(feature = "serde_json")]
+    serde_json::Value,
 }
 
 /// Represent a way to encode/decode text data into a Rust type.