Check input file for additional entries

This will prevent the application from creating output without these
additional entities, which would be missing in output.

Instead, the application will exit with an error message.
This commit is contained in:
2023-06-02 23:05:35 +02:00
parent 31a1dcb63e
commit 1224f93764
7 changed files with 80 additions and 40 deletions

View File

@@ -27,6 +27,7 @@ use serde::{Deserialize, Serialize};
use crate::model::Ordner;
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct DataCatalogue {
#[serde(rename = "Name")]
name: String,
@@ -55,12 +56,14 @@ pub struct DataCatalogue {
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct Entries {
#[serde(rename = "Entry")]
entry: Vec<Entry>,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct Entry {
#[serde(rename = "PropertyCatalogue")]
#[serde(skip_serializing_if = "Option::is_none")]
@@ -122,12 +125,14 @@ pub struct Entry {
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct Use {
#[serde(rename = "ProgramModule", default)]
program_module: Vec<ProgramModule>,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct ProgramModule {
#[serde(rename = "@program")]
program: String,