section-config: use builder pattern for ObjectSchema

To prepare for a breaking change in proxmox-schema.
Since new fields in the schema constitute a breaking change, using the
builder methods will let this compile later as well.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2025-01-14 10:26:05 +01:00
parent c99a31c66f
commit 3c34ef5573

View File

@ -1034,19 +1034,11 @@ fn test_section_config_with_additional_properties() {
),
];
const USER_PROPERTIES: ObjectSchema = ObjectSchema {
description: "user properties",
properties: &PROPERTIES,
additional_properties: false,
default_key: None,
};
const USER_PROPERTIES: ObjectSchema = ObjectSchema::new("user properties", &PROPERTIES);
const USER_PROPERTIES_WITH_ADDITIONAL: ObjectSchema = ObjectSchema {
description: "user properties with additional",
properties: &PROPERTIES,
additional_properties: true,
default_key: None,
};
const USER_PROPERTIES_WITH_ADDITIONAL: ObjectSchema =
ObjectSchema::new("user properties with additional", &PROPERTIES)
.additional_properties(true);
let plugin = SectionConfigPlugin::new(
"user".to_string(),
@ -1104,12 +1096,7 @@ fn test_section_config_with_unknown_section_types() {
),
];
const USER_PROPERTIES: ObjectSchema = ObjectSchema {
description: "user properties",
properties: &PROPERTIES,
additional_properties: false,
default_key: None,
};
const USER_PROPERTIES: ObjectSchema = ObjectSchema::new("user properties", &PROPERTIES);
let plugin = SectionConfigPlugin::new(
"user".to_string(),