[yew-devel] [PATCH yew-comp 1/2] common api types: make BasicRealmInfo compatible with proxmox ve

Shannon Sterz s.sterz at proxmox.com
Tue Nov 25 12:10:56 CET 2025


the perl return types for booleans are integers so need special
handling when deserializing. otherwise, the realm selector will just
remain empty.

Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
---
 src/common_api_types.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/common_api_types.rs b/src/common_api_types.rs
index a9d3c2a..be5c64e 100644
--- a/src/common_api_types.rs
+++ b/src/common_api_types.rs
@@ -15,7 +15,8 @@ pub struct BasicRealmInfo {
     #[serde(rename = "type")]
     pub ty: String,
     /// True if it is the default realm
-    #[serde(skip_serializing_if = "Option::is_none")]
+    #[serde(deserialize_with = "proxmox_serde::perl::deserialize_bool")]
+    #[serde(default, skip_serializing_if = "Option::is_none")]
     pub default: Option<bool>,
     #[serde(skip_serializing_if = "Option::is_none")]
     pub comment: Option<String>,
-- 
2.47.3





More information about the yew-devel mailing list