diff --git a/komorebi/src/container.rs b/komorebi/src/container.rs index 6819c5e3..de496451 100644 --- a/komorebi/src/container.rs +++ b/komorebi/src/container.rs @@ -11,7 +11,6 @@ use crate::window::Window; #[derive(Debug, Clone, Serialize, Deserialize, Getters, JsonSchema)] pub struct Container { - #[serde(skip_serializing)] #[getset(get = "pub")] id: String, windows: Ring, diff --git a/komorebi/src/monitor.rs b/komorebi/src/monitor.rs index 71d5139b..e03eb46d 100644 --- a/komorebi/src/monitor.rs +++ b/komorebi/src/monitor.rs @@ -37,10 +37,9 @@ pub struct Monitor { #[getset(get_copy = "pub", set = "pub")] work_area_offset: Option, workspaces: Ring, - #[serde(skip_serializing)] + #[serde(skip_serializing_if = "Option::is_none")] #[getset(get_copy = "pub", set = "pub")] last_focused_workspace: Option, - #[serde(skip_serializing)] #[getset(get_mut = "pub")] workspace_names: HashMap, } diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index e521a5d1..c6fdfdf9 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -42,12 +42,12 @@ pub struct Workspace { containers: Ring, #[getset(get = "pub", get_mut = "pub", set = "pub")] monocle_container: Option, - #[serde(skip_serializing)] + #[serde(skip_serializing_if = "Option::is_none")] #[getset(get_copy = "pub", set = "pub")] monocle_container_restore_idx: Option, #[getset(get = "pub", get_mut = "pub", set = "pub")] maximized_window: Option, - #[serde(skip_serializing)] + #[serde(skip_serializing_if = "Option::is_none")] #[getset(get_copy = "pub", set = "pub")] maximized_window_restore_idx: Option, #[getset(get = "pub", get_mut = "pub")] @@ -62,7 +62,6 @@ pub struct Workspace { workspace_padding: Option, #[getset(get_copy = "pub", set = "pub")] container_padding: Option, - #[serde(skip_serializing)] #[getset(get = "pub", set = "pub")] latest_layout: Vec, #[getset(get = "pub", get_mut = "pub", set = "pub")]