From cc82d42e8dc4f1b17b6acfcbcedc0dc96a3d7738 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Wed, 21 Jun 2023 09:22:56 +0200 Subject: [PATCH] tui: skip serializing empty fields for install config Signed-off-by: Christoph Heiss --- proxmox-tui-installer/src/setup.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/proxmox-tui-installer/src/setup.rs b/proxmox-tui-installer/src/setup.rs index 2a66f41..5731c4d 100644 --- a/proxmox-tui-installer/src/setup.rs +++ b/proxmox-tui-installer/src/setup.rs @@ -110,15 +110,24 @@ pub struct InstallConfig { #[serde(serialize_with = "serialize_fstype")] filesys: FsType, hdsize: u64, + #[serde(skip_serializing_if = "Option::is_none")] swapsize: Option, + #[serde(skip_serializing_if = "Option::is_none")] maxroot: Option, + #[serde(skip_serializing_if = "Option::is_none")] minfree: Option, + #[serde(skip_serializing_if = "Option::is_none")] maxvz: Option, + #[serde(skip_serializing_if = "Option::is_none")] zfs_opts: Option, - #[serde(serialize_with = "serialize_disk_opt")] + #[serde( + serialize_with = "serialize_disk_opt", + skip_serializing_if = "Option::is_none" + )] target_hd: Option, + #[serde(skip_serializing_if = "HashMap::is_empty")] disk_selection: HashMap, country: String,