[pve-devel] [PATCH proxmox v3 4/4] api-macro: add allof schema to enum

Stefan Hanreich s.hanreich at proxmox.com
Thu May 22 18:16:20 CEST 2025


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 9b122f9c..31a715db 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