From c794c42919983914cb953eae307a81f7e4e9302c Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 14 Jan 2025 11:50:58 +0100 Subject: [PATCH] schema: drop deprecated code Signed-off-by: Wolfgang Bumiller --- proxmox-schema/src/schema.rs | 67 ------------------------------------ 1 file changed, 67 deletions(-) diff --git a/proxmox-schema/src/schema.rs b/proxmox-schema/src/schema.rs index 4f6faff1..0bb90487 100644 --- a/proxmox-schema/src/schema.rs +++ b/proxmox-schema/src/schema.rs @@ -1671,31 +1671,6 @@ pub fn parse_boolean(value_str: &str) -> Result { } } -/// Parse a complex property string (`ApiStringFormat::PropertyString`) -#[deprecated(note = "this is now a method of Schema")] -pub fn parse_property_string(value_str: &str, schema: &'static Schema) -> Result { - schema.parse_property_string(value_str) -} - -/// Parse a simple value (no arrays and no objects) -#[deprecated(note = "this is now a method of Schema")] -pub fn parse_simple_value(value_str: &str, schema: &Schema) -> Result { - schema.parse_simple_value(value_str) -} - -/// Parse key/value pairs and verify with object schema -/// -/// - `test_required`: is set, checks if all required properties are -/// present. -#[deprecated(note = "this is now a method of parameter schema types")] -pub fn parse_parameter_strings>( - data: &[(String, String)], - schema: T, - test_required: bool, -) -> Result { - do_parse_parameter_strings(schema.into(), data, test_required) -} - fn do_parse_parameter_strings( schema: ParameterSchema, data: &[(String, String)], @@ -1777,48 +1752,6 @@ fn do_parse_parameter_strings( } } -/// Verify JSON value with `schema`. -#[deprecated(note = "use the method schema.verify_json() instead")] -pub fn verify_json(data: &Value, schema: &Schema) -> Result<(), Error> { - schema.verify_json(data) -} - -/// Verify JSON value using a `StringSchema`. -#[deprecated(note = "use the method string_schema.verify_json() instead")] -pub fn verify_json_string(data: &Value, schema: &StringSchema) -> Result<(), Error> { - schema.verify_json(data) -} - -/// Verify JSON value using a `BooleanSchema`. -#[deprecated(note = "use the method boolean_schema.verify_json() instead")] -pub fn verify_json_boolean(data: &Value, schema: &BooleanSchema) -> Result<(), Error> { - schema.verify_json(data) -} - -/// Verify JSON value using an `IntegerSchema`. -#[deprecated(note = "use the method integer_schema.verify_json() instead")] -pub fn verify_json_integer(data: &Value, schema: &IntegerSchema) -> Result<(), Error> { - schema.verify_json(data) -} - -/// Verify JSON value using an `NumberSchema`. -#[deprecated(note = "use the method number_schema.verify_json() instead")] -pub fn verify_json_number(data: &Value, schema: &NumberSchema) -> Result<(), Error> { - schema.verify_json(data) -} - -/// Verify JSON value using an `ArraySchema`. -#[deprecated(note = "use the method array_schema.verify_json() instead")] -pub fn verify_json_array(data: &Value, schema: &ArraySchema) -> Result<(), Error> { - schema.verify_json(data) -} - -/// Verify JSON value using an `ObjectSchema`. -#[deprecated(note = "use the verify_json() method via the ObjectSchemaType trait instead")] -pub fn verify_json_object(data: &Value, schema: &dyn ObjectSchemaType) -> Result<(), Error> { - schema.verify_json(data) -} - /// API types should define an "updater type" via this trait in order to support derived "Updater" /// structs more easily. ///