[pve-devel] applied: [PATCH proxmox v4 5/5] api-macro: add allof schema to enum

Wolfgang Bumiller w.bumiller at proxmox.com
Fri Jul 4 15:48:14 CEST 2025


applied this one early, thanks

On Wed, Jul 02, 2025 at 04:49:50PM +0200, Gabriel Goller wrote:
> 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