fixes serialization of regex pattern + description

This commit is contained in:
Keagan McClelland
2022-06-07 17:27:51 -06:00
parent 9217d00528
commit 901ea6203e

View File

@@ -1170,6 +1170,7 @@ pub struct Pattern {
#[derive(Clone, Debug, Serialize)] #[derive(Clone, Debug, Serialize)]
pub struct ValueSpecString { pub struct ValueSpecString {
#[serde(flatten)]
pub pattern: Option<Pattern>, pub pattern: Option<Pattern>,
pub copyable: bool, pub copyable: bool,
pub masked: bool, pub masked: bool,
@@ -2166,10 +2167,9 @@ fn missing_pattern_produces_error() {
#[test] #[test]
fn regex_control() { fn regex_control() {
assert!( let spec = serde_yaml::from_reader::<_, ConfigSpec>(std::io::Cursor::new(include_bytes!(
serde_yaml::from_reader::<_, ConfigSpec>(std::io::Cursor::new(include_bytes!( "../../test/config-spec/lnd-correct.yaml"
"../../test/config-spec/lnd-correct.yaml" )))
))) .unwrap();
.is_ok() println!("{}", serde_json::to_string_pretty(&spec).unwrap());
)
} }