From 9f5b72db5f8960c90a1ffbc2baa344a058d05c8c Mon Sep 17 00:00:00 2001 From: Xavier Vello Date: Tue, 30 Apr 2024 12:24:13 +0200 Subject: [PATCH] capture: don't serialize sent_at if empty (#28) --- capture/src/api.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/capture/src/api.rs b/capture/src/api.rs index 91ed578..8e595fc 100644 --- a/capture/src/api.rs +++ b/capture/src/api.rs @@ -87,7 +87,10 @@ pub struct ProcessedEvent { pub ip: String, pub data: String, pub now: String, - #[serde(with = "time::serde::rfc3339::option")] + #[serde( + with = "time::serde::rfc3339::option", + skip_serializing_if = "Option::is_none" + )] pub sent_at: Option, pub token: String, }