v0.10.0
This commit is contained in:
+10
-7
@@ -120,13 +120,16 @@ fn validate_flow_shared_inputs(settings: &mut RuntimeSettings, state: &AppState)
|
||||
"night_mode" | "constant") {
|
||||
return Err(AppError::BadRequest(format!("unsupported shared Flow input kind: {}", item.kind)));
|
||||
}
|
||||
let condition = crate::models::FlowCondition {
|
||||
id: item.id.clone(),
|
||||
kind: item.kind.clone(),
|
||||
config: item.config.clone(),
|
||||
inputs: Vec::new(),
|
||||
};
|
||||
validate_condition(&condition, state)?;
|
||||
if !item.config.is_object() {
|
||||
return Err(AppError::BadRequest("shared Flow input config must be an object".into()));
|
||||
}
|
||||
if item.config.get("operator").is_some() {
|
||||
return Err(AppError::BadRequest("shared Flow inputs are value sources; operator belongs to the Flow block".into()));
|
||||
}
|
||||
if shared_input_comparison_kind(&item.kind) && item.config.get("value").is_some() {
|
||||
return Err(AppError::BadRequest("shared Flow inputs are value sources; comparison value belongs to the Flow block".into()));
|
||||
}
|
||||
validate_shared_input_source(&item.kind, &item.config, state)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user