From 2c4fb96fb284dd34590753f228bf8abaf60c2f9e Mon Sep 17 00:00:00 2001 From: Joe Prosser Date: Wed, 9 Oct 2024 12:02:48 +0100 Subject: [PATCH] dont serialize field id when none --- api/src/resources/comment.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/src/resources/comment.rs b/api/src/resources/comment.rs index e1998ca..d5ca1df 100644 --- a/api/src/resources/comment.rs +++ b/api/src/resources/comment.rs @@ -873,6 +873,7 @@ pub struct NewEntityWithSpan { pub name: EntityName, pub formatted_value: String, pub span: NewEntitySpan, + #[serde(skip_serializing_if = "Option::is_none")] pub field_id: Option, } @@ -883,6 +884,7 @@ pub struct FieldId(pub String); pub struct NewEntityWithSpans { pub name: EntityName, pub formatted_value: String, + #[serde(skip_serializing_if = "Option::is_none")] pub field_id: Option, pub spans: Vec, } @@ -900,6 +902,7 @@ pub struct Entity { pub name: EntityName, pub formatted_value: String, pub spans: Vec, + #[serde(skip_serializing_if = "Option::is_none")] pub field_id: Option, }