Skip to content

Commit

Permalink
feat(cli): round trip entity def flags (#309)
Browse files Browse the repository at this point in the history
* feat(cli): round trip entity def flags
  • Loading branch information
joe-prosser authored Aug 29, 2024
1 parent 4776788 commit e9daf5c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Unreleased
- Add dataset flags to `create-dataset`
- Add `parse aic-classification-csv`
- Round trip `_entity_def_flags`

# v0.31.0
- Add `get keyed sync states`
Expand Down
12 changes: 12 additions & 0 deletions api/src/resources/entity_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ pub struct EntityDef {
pub name: Name,
pub title: String,
pub trainable: bool,
#[serde(default)]
#[serde(rename = "_entity_def_flags")]
pub entity_def_flags: Vec<EntityDefFlag>,
}

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
#[serde(rename_all(serialize = "snake_case", deserialize = "snake_case"))]
pub enum EntityDefFlag {
AppearsVerbatim,
}

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
Expand All @@ -22,6 +31,9 @@ pub struct NewEntityDef {
pub name: Name,
pub title: String,
pub trainable: bool,
#[serde(rename = "_entity_def_flags")]
#[serde(default)]
pub entity_def_flags: Vec<EntityDefFlag>,
}

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

0 comments on commit e9daf5c

Please sign in to comment.