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)]
pub struct ValueSpecString {
#[serde(flatten)]
pub pattern: Option<Pattern>,
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());
}