Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): make field_id optional for back compat #323

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions api/src/resources/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FieldId>,
}

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Eq)]
Expand All @@ -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<FieldId>,
pub spans: Vec<NewEntitySpan>,
}

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

#[derive(Debug, PartialEq, Clone, Deserialize, Serialize, Eq)]
Expand Down
Loading