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

@@ -30,6 +30,7 @@ use crate::model::property_catalogue::PropertyCatalogue;
use crate::model::unterformular::Unterformular;
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct OnkostarEditor {
#[serde(rename = "InfoXML")]
info_xml: InfoXML,
@@ -49,6 +50,7 @@ impl OnkostarEditor {
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct InfoXML {
#[serde(rename = "DatumXML")]
datum_xml: String,
@@ -59,6 +61,7 @@ pub struct InfoXML {
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
struct Editor {
#[serde(rename = "PropertyCatalogue")]
property_catalogue: Vec<PropertyCatalogue>,
@@ -71,6 +74,7 @@ struct Editor {
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct Bibliothek {
#[serde(rename = "Name")]
name: String,