diff --git a/xso/Cargo.toml b/xso/Cargo.toml index b360f04e..a79b3926 100644 --- a/xso/Cargo.toml +++ b/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" ] diff --git a/xso/ChangeLog b/xso/ChangeLog index d2310f54..2e5dd300 100644 --- a/xso/ChangeLog +++ b/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 diff --git a/xso/src/text.rs b/xso/src/text.rs index 4fe25654..768eabc5 100644 --- a/xso/src/text.rs +++ b/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.