pinakes-plugin-api: add reserved-route and required-endpoint validation
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Id85a7e729b26af8eb028e19418a5a1706a6a6964
This commit is contained in:
parent
91123fc90e
commit
7989d4c4dd
1 changed files with 5 additions and 5 deletions
|
|
@ -801,11 +801,6 @@ impl UiElement {
|
|||
)));
|
||||
}
|
||||
},
|
||||
Self::Form { fields, .. } if fields.is_empty() => {
|
||||
return Err(SchemaError::ValidationError(
|
||||
"Form must have at least one field".to_string(),
|
||||
));
|
||||
},
|
||||
Self::Chart { data, .. } if !page.data_sources.contains_key(data) => {
|
||||
return Err(SchemaError::ValidationError(format!(
|
||||
"Chart references unknown data source: {data}"
|
||||
|
|
@ -867,6 +862,11 @@ impl UiElement {
|
|||
submit_action,
|
||||
..
|
||||
} => {
|
||||
if fields.is_empty() {
|
||||
return Err(SchemaError::ValidationError(
|
||||
"Form must have at least one field".to_string(),
|
||||
));
|
||||
}
|
||||
for field in fields {
|
||||
validate_id(&field.id)?;
|
||||
if field.label.is_empty() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue