[pve-devel] [PATCH proxmox v4 5/5] api-macro: add allof schema to enum
Gabriel Goller
g.goller at proxmox.com
Wed Jul 2 16:49:50 CEST 2025
From: Stefan Hanreich <s.hanreich at proxmox.com>
The API macro required the enum variants to either have a oneOf or
ObjectSchema, but did not allow allOf schemas. There's not really a
reason to not allow allOf as well, since they implement
ObjectSchemaType as well and represent an ObjectSchema, just like
oneOf and ObjectSchema do.
This is in preparation for the SDN fabrics, where sections use the
allOf schema to merge general properties with protocol-specific
properties.
Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
proxmox-api-macro/src/api/enums.rs | 1 +
1 file changed, 1 insertion(+)
diff --git a/proxmox-api-macro/src/api/enums.rs b/proxmox-api-macro/src/api/enums.rs
index 9b122f9c98ff..31a715dbf511 100644
--- a/proxmox-api-macro/src/api/enums.rs
+++ b/proxmox-api-macro/src/api/enums.rs
@@ -253,6 +253,7 @@ fn handle_section_config_enum(
match &<#ty as ::proxmox_schema::ApiType>::API_SCHEMA {
::proxmox_schema::Schema::Object(schema) => schema,
::proxmox_schema::Schema::OneOf(schema) => schema,
+ ::proxmox_schema::Schema::AllOf(schema) => schema,
_ => panic!("enum requires an object schema"),
}
}
--
2.39.5
More information about the pve-devel
mailing list