Skip to content

Commit

Permalink
dont serialize field id when none
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-prosser committed Oct 9, 2024
1 parent 3af0f94 commit 2c4fb96
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/src/resources/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FieldId>,
}

Expand All @@ -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<FieldId>,
pub spans: Vec<NewEntitySpan>,
}
Expand All @@ -900,6 +902,7 @@ pub struct Entity {
pub name: EntityName,
pub formatted_value: String,
pub spans: Vec<EntitySpan>,
#[serde(skip_serializing_if = "Option::is_none")]
pub field_id: Option<FieldId>,
}

Expand Down

0 comments on commit 2c4fb96

Please sign in to comment.