[pdm-devel] [PATCH datacenter-manager v4 06/18] ui: dashboard types: add missing 'default's to de-serialization
Dominik Csapak
d.csapak at proxmox.com
Mon Nov 24 13:07:38 CET 2025
otherwise a layout with no rows or empty description can be serialized,
but not deserialized.
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v3:
* fix typo in commit message
* also add the default to the description, same problem
ui/src/dashboard/types.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/src/dashboard/types.rs b/ui/src/dashboard/types.rs
index c79c38ab..df4a3668 100644
--- a/ui/src/dashboard/types.rs
+++ b/ui/src/dashboard/types.rs
@@ -7,7 +7,7 @@ use crate::pve::GuestType;
#[derive(Serialize, Deserialize, PartialEq, Clone)]
#[serde(rename_all = "kebab-case")]
pub struct ViewTemplate {
- #[serde(skip_serializing_if = "String::is_empty")]
+ #[serde(default, skip_serializing_if = "String::is_empty")]
pub description: String,
pub layout: ViewLayout,
}
@@ -17,7 +17,7 @@ pub struct ViewTemplate {
#[serde(tag = "layout-type")]
pub enum ViewLayout {
Rows {
- #[serde(skip_serializing_if = "Vec::is_empty")]
+ #[serde(default, skip_serializing_if = "Vec::is_empty")]
rows: Vec<Vec<RowWidget>>,
},
}
--
2.47.3
More information about the pdm-devel
mailing list