From 4bd46d6ad36fa51fa06b6033abcd417c89d2a2ee Mon Sep 17 00:00:00 2001 From: MicaiahReid Date: Fri, 28 Jul 2023 11:12:25 -0400 Subject: [PATCH] skip serialization on optional fields --- components/chainhook-sdk/src/chainhooks/types.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/chainhook-sdk/src/chainhooks/types.rs b/components/chainhook-sdk/src/chainhooks/types.rs index ad9cc22da..19dfcc1ee 100644 --- a/components/chainhook-sdk/src/chainhooks/types.rs +++ b/components/chainhook-sdk/src/chainhooks/types.rs @@ -770,7 +770,9 @@ pub enum StacksContractDeploymentPredicate { #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema)] #[serde(rename_all = "snake_case")] pub struct StacksPrintEventBasedPredicate { + #[serde(skip_serializing_if = "Option::is_none")] pub contract_identifier: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub contains: Option, }