rest-server: bump schema to 1.2 and use convenience methods

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2022-02-11 14:09:45 +01:00
parent fd7f760304
commit 5b93835744
2 changed files with 9 additions and 8 deletions

View File

@ -147,13 +147,14 @@ impl OutputFormatter for ExtJsFormatter {
let message: String;
let mut errors = HashMap::new();
if let Some(param_err) = err.downcast_ref::<ParameterError>() {
for (name, err) in param_err.errors().iter() {
errors.insert(name, err.to_string());
match err.downcast::<ParameterError>() {
Ok(param_err) => {
for (name, err) in param_err {
errors.insert(name, err.to_string());
}
message = String::from("parameter verification errors");
}
message = String::from("parameter verification errors");
} else {
message = err.to_string();
Err(err) => message = err.to_string(),
}
let result = json!({