From 9642f47512fe4191f501672a84e232908b625c64 Mon Sep 17 00:00:00 2001 From: ppom Date: Mon, 17 Feb 2025 12:00:00 +0100 Subject: [PATCH] Config: permit top-level `definitions` key closes #118 --- src/concepts/config.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/concepts/config.rs b/src/concepts/config.rs index 0a56a11..3e9c639 100644 --- a/src/concepts/config.rs +++ b/src/concepts/config.rs @@ -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();