mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-02 10:07:43 +00:00
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:
parent
c99a31c66f
commit
3c34ef5573
@ -1034,19 +1034,11 @@ fn test_section_config_with_additional_properties() {
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
const USER_PROPERTIES: ObjectSchema = ObjectSchema {
|
const USER_PROPERTIES: ObjectSchema = ObjectSchema::new("user properties", &PROPERTIES);
|
||||||
description: "user properties",
|
|
||||||
properties: &PROPERTIES,
|
|
||||||
additional_properties: false,
|
|
||||||
default_key: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
const USER_PROPERTIES_WITH_ADDITIONAL: ObjectSchema = ObjectSchema {
|
const USER_PROPERTIES_WITH_ADDITIONAL: ObjectSchema =
|
||||||
description: "user properties with additional",
|
ObjectSchema::new("user properties with additional", &PROPERTIES)
|
||||||
properties: &PROPERTIES,
|
.additional_properties(true);
|
||||||
additional_properties: true,
|
|
||||||
default_key: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
let plugin = SectionConfigPlugin::new(
|
let plugin = SectionConfigPlugin::new(
|
||||||
"user".to_string(),
|
"user".to_string(),
|
||||||
@ -1104,12 +1096,7 @@ fn test_section_config_with_unknown_section_types() {
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
const USER_PROPERTIES: ObjectSchema = ObjectSchema {
|
const USER_PROPERTIES: ObjectSchema = ObjectSchema::new("user properties", &PROPERTIES);
|
||||||
description: "user properties",
|
|
||||||
properties: &PROPERTIES,
|
|
||||||
additional_properties: false,
|
|
||||||
default_key: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
let plugin = SectionConfigPlugin::new(
|
let plugin = SectionConfigPlugin::new(
|
||||||
"user".to_string(),
|
"user".to_string(),
|
||||||
|
Loading…
Reference in New Issue
Block a user