Skip to content

Commit

Permalink
Merge pull request #312 from korpling/fix/deny-unknown-fields
Browse files Browse the repository at this point in the history
Fix/deny unknown fields
  • Loading branch information
MartinKl authored Sep 18, 2024
2 parents 517740f + 70a82d8 commit 8bbcc2b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `xlsx` importer did not give the correct node name to segmentation token. Due
to this inconsistency, span annotations on segmentation nodes where not
connected to the segmentation token.
- unknown keys in toml configurations are now denied not only in config context, but globally in a workflow file

## [0.16.0] - 2024-09-02

Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ impl Display for StepID {
pub trait Step {}

#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ImporterStep {
#[serde(flatten)]
module: ReadFrom,
Expand All @@ -473,6 +474,7 @@ impl ImporterStep {
impl Step for ImporterStep {}

#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ExporterStep {
#[serde(flatten)]
module: WriteAs,
Expand All @@ -495,6 +497,7 @@ impl ExporterStep {
impl Step for ExporterStep {}

#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ManipulatorStep {
#[serde(flatten)]
module: GraphOp,
Expand Down
1 change: 1 addition & 0 deletions src/workflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub enum StatusMessage {
/// The manipulators are executed in their defined sequence and can change the annotation graph.
/// Last, all exporters are called with the now read-only annotation graph in parallel.
#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Workflow {
import: Vec<ImporterStep>,
graph_op: Option<Vec<ManipulatorStep>>,
Expand Down

0 comments on commit 8bbcc2b

Please sign in to comment.