From 559869c2b891038783c6311807e2c2dd6847e733 Mon Sep 17 00:00:00 2001 From: clerie Date: Sat, 24 Aug 2024 19:06:22 +0200 Subject: [PATCH] Skip serialization for empty fields --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index 97fdea0..953da5e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,8 +42,11 @@ struct Cli { #[derive(Serialize)] struct MessageMap { + #[serde(skip_serializing_if = "Option::is_none")] server_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] domain_name_servers: Option>, + #[serde(skip_serializing_if = "Option::is_none")] domain_search_list: Option>, }