From 901ea6203e9b743eb7e5f59a6bbd0a69cb624022 Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Tue, 7 Jun 2022 17:27:51 -0600 Subject: [PATCH] fixes serialization of regex pattern + description --- backend/src/config/spec.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/config/spec.rs b/backend/src/config/spec.rs index 8d4627d50..8f61d32d6 100644 --- a/backend/src/config/spec.rs +++ b/backend/src/config/spec.rs @@ -1170,6 +1170,7 @@ pub struct Pattern { #[derive(Clone, Debug, Serialize)] pub struct ValueSpecString { + #[serde(flatten)] pub pattern: Option, pub copyable: bool, pub masked: bool, @@ -2166,10 +2167,9 @@ fn missing_pattern_produces_error() { #[test] fn regex_control() { - assert!( - serde_yaml::from_reader::<_, ConfigSpec>(std::io::Cursor::new(include_bytes!( - "../../test/config-spec/lnd-correct.yaml" - ))) - .is_ok() - ) + let spec = serde_yaml::from_reader::<_, ConfigSpec>(std::io::Cursor::new(include_bytes!( + "../../test/config-spec/lnd-correct.yaml" + ))) + .unwrap(); + println!("{}", serde_json::to_string_pretty(&spec).unwrap()); }