diff --git a/src/modes/generate_config.rs b/src/modes/generate_config.rs index f362022..826e2c1 100644 --- a/src/modes/generate_config.rs +++ b/src/modes/generate_config.rs @@ -161,11 +161,18 @@ fn convert_outputs_to_string_map( ) -> std::collections::HashMap { let mut result = std::collections::HashMap::new(); for (key, value) in outputs { - if let Some(str_value) = value.as_str() { - result.insert(key.clone(), str_value.to_string()); - } else { - // Convert non-string values to their YAML string representation - result.insert(key.clone(), serde_yaml::to_string(value).unwrap_or_default()); + match value { + serde_yaml::Value::Null => { + // For null, we want to output "null" as a string + result.insert(key.clone(), "null".to_string()); + } + serde_yaml::Value::String(s) => { + result.insert(key.clone(), s.clone()); + } + _ => { + // Convert other values to their YAML string representation + result.insert(key.clone(), serde_yaml::to_string(value).unwrap_or_default()); + } } } result