diff --git a/proxmox-router/Cargo.toml b/proxmox-router/Cargo.toml index 2636fd70..28616d8b 100644 --- a/proxmox-router/Cargo.toml +++ b/proxmox-router/Cargo.toml @@ -23,7 +23,7 @@ rustyline = { version = "7", optional = true } libc = { version = "0.2", optional = true } proxmox-lang = { path = "../proxmox-lang", version = "1.0" } -proxmox-schema = { path = "../proxmox-schema", version = "1.0" } +proxmox-schema = { path = "../proxmox-schema", version = "1.1" } [features] default = [ "cli" ] diff --git a/proxmox-router/src/cli/getopts.rs b/proxmox-router/src/cli/getopts.rs index 8e2fac19..d44a7ab3 100644 --- a/proxmox-router/src/cli/getopts.rs +++ b/proxmox-router/src/cli/getopts.rs @@ -192,7 +192,7 @@ pub fn parse_arguments>( data.push((name.to_string(), value.to_string())); } - let options = parse_parameter_strings(&data, schema, true)?; + let options = schema.parse_parameter_strings(&data, true)?; Ok((options, remaining)) } diff --git a/proxmox-section-config/Cargo.toml b/proxmox-section-config/Cargo.toml index 78866610..c273025f 100644 --- a/proxmox-section-config/Cargo.toml +++ b/proxmox-section-config/Cargo.toml @@ -14,6 +14,6 @@ hex = "0.4" serde = "1.0" serde_json = "1.0" -proxmox-schema = { path = "../proxmox-schema", version = "1.0.0" } +proxmox-schema = { path = "../proxmox-schema", version = "1.1" } # FIXME: remove! proxmox-lang = { path = "../proxmox-lang", version = "1.0.0" } diff --git a/proxmox-section-config/src/lib.rs b/proxmox-section-config/src/lib.rs index 80204851..85ff81b8 100644 --- a/proxmox-section-config/src/lib.rs +++ b/proxmox-section-config/src/lib.rs @@ -325,13 +325,13 @@ impl SectionConfig { let plugin = self.plugins.get(type_name).unwrap(); let id_schema = plugin.get_id_schema().unwrap_or(self.id_schema); - if let Err(err) = parse_simple_value(section_id, id_schema) { + if let Err(err) = id_schema.parse_simple_value(section_id) { bail!("syntax error in section identifier: {}", err.to_string()); } if section_id.chars().any(|c| c.is_control()) { bail!("detected unexpected control character in section ID."); } - if let Err(err) = verify_json_object(section_config, plugin.properties) { + if let Err(err) = plugin.properties.verify_json(section_config) { bail!("verify section '{}' failed - {}", section_id, err); } @@ -405,7 +405,7 @@ impl SectionConfig { if let Some(plugin) = self.plugins.get(§ion_type) { let id_schema = plugin.get_id_schema().unwrap_or(self.id_schema); - if let Err(err) = parse_simple_value(§ion_id, id_schema) { + if let Err(err) = id_schema.parse_simple_value(§ion_id) { bail!( "syntax error in section identifier: {}", err.to_string() @@ -449,7 +449,7 @@ impl SectionConfig { None => bail!("unknown property '{}'", key), }; - let value = match parse_simple_value(&value, prop_schema) { + let value = match prop_schema.parse_simple_value(&value) { Ok(value) => value, Err(err) => { bail!("property '{}': {}", key, err.to_string());