From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 058281FF183 for ; Wed, 2 Jul 2025 16:52:53 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5AF311EAD6; Wed, 2 Jul 2025 16:51:44 +0200 (CEST) From: Gabriel Goller To: pve-devel@lists.proxmox.com Date: Wed, 2 Jul 2025 16:49:50 +0200 Message-Id: <20250702145101.894299-6-g.goller@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250702145101.894299-1-g.goller@proxmox.com> References: <20250702145101.894299-1-g.goller@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.019 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH proxmox v4 5/5] api-macro: add allof schema to enum X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" From: Stefan Hanreich 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 --- 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 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel