Config: permit top-level definitions key

closes #118
This commit is contained in:
ppom 2025-02-17 12:00:00 +01:00
commit 9642f47512

View file

@ -33,6 +33,10 @@ pub struct Config {
#[serde(default = "dot")]
state_directory: String,
// This field only serve the purpose of having a top-level place for saving YAML variables
#[serde(default, skip_serializing, rename = "definitions")]
_definitions: serde_json::Value,
}
fn dot() -> String {
@ -74,6 +78,9 @@ impl Config {
self.concurrency = num_cpus::get();
}
// Nullify this useless field
self._definitions = serde_json::Value::Null;
let mut new_patterns = BTreeMap::new();
for (key, value) in &self.patterns {
let mut value = value.as_ref().clone();