feat: use __fallback in bluprint for the else
This commit is contained in:
parent
4589c51cd3
commit
d8723c5497
|
@ -179,7 +179,16 @@ impl Validator {
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(Validator {
|
Ok(Validator {
|
||||||
title: format!("{}.{}_{}", &module.name, &def.name, &func.name),
|
title: format!(
|
||||||
|
"{}.{}_{}",
|
||||||
|
&module.name,
|
||||||
|
&def.name,
|
||||||
|
if func.name == "else" {
|
||||||
|
"__fallback"
|
||||||
|
} else {
|
||||||
|
&func.name
|
||||||
|
}
|
||||||
|
),
|
||||||
description: func.doc.clone(),
|
description: func.doc.clone(),
|
||||||
parameters,
|
parameters,
|
||||||
datum,
|
datum,
|
||||||
|
@ -858,13 +867,11 @@ mod tests {
|
||||||
let mut definitions = fixture_definitions();
|
let mut definitions = fixture_definitions();
|
||||||
definitions.insert(
|
definitions.insert(
|
||||||
&schema,
|
&schema,
|
||||||
Schema::Data(Data::AnyOf(vec![
|
Schema::Data(Data::AnyOf(vec![Constructor {
|
||||||
Constructor {
|
|
||||||
index: 0,
|
index: 0,
|
||||||
fields: vec![Declaration::Referenced(Reference::new("Bool")).into()],
|
fields: vec![Declaration::Referenced(Reference::new("Bool")).into()],
|
||||||
}
|
}
|
||||||
.into(),
|
.into()]))
|
||||||
]))
|
|
||||||
.into(),
|
.into(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue