diff --git a/api/src/resources/comment.rs b/api/src/resources/comment.rs index bff3be87..d5ca1df5 100644 --- a/api/src/resources/comment.rs +++ b/api/src/resources/comment.rs @@ -873,7 +873,8 @@ pub struct NewEntityWithSpan { pub name: EntityName, pub formatted_value: String, pub span: NewEntitySpan, - pub field_id: FieldId, + #[serde(skip_serializing_if = "Option::is_none")] + pub field_id: Option, } #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Eq)] @@ -883,7 +884,8 @@ pub struct FieldId(pub String); pub struct NewEntityWithSpans { pub name: EntityName, pub formatted_value: String, - pub field_id: FieldId, + #[serde(skip_serializing_if = "Option::is_none")] + pub field_id: Option, pub spans: Vec, } @@ -900,7 +902,8 @@ pub struct Entity { pub name: EntityName, pub formatted_value: String, pub spans: Vec, - pub field_id: FieldId, + #[serde(skip_serializing_if = "Option::is_none")] + pub field_id: Option, } #[derive(Debug, PartialEq, Clone, Deserialize, Serialize, Eq)]