mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
fixes serialization of regex pattern + description
This commit is contained in:
@@ -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());
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user