From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 4496C1FF0C1 for ; Fri, 18 Sep 2026 13:57:57 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 7AF022157C; Fri, 18 Sep 2026 13:57:54 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH widget-toolkit] api-viewer: fix handling of 'null' return schema Date: Fri, 18 Sep 2026 13:56:51 +0200 Message-ID: <20260918115750.3653121-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.462 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: WC56XMW7PQHG6WSIOP5FTN2J53F2NUEP X-Message-ID-Hash: WC56XMW7PQHG6WSIOP5FTN2J53F2NUEP X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: when the return schema is 'null', there are no schema properties to check, so don't try it it all. This fixes an issue where rendering would stop with the error: `can't access property "properties", schema is undefined` Fixes: 7826b0a (api-viewer: support allOf and proper oneOf) Signed-off-by: Dominik Csapak --- src/api-viewer/APIViewer.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api-viewer/APIViewer.js b/src/api-viewer/APIViewer.js index 3fe09d1..ab01eaa 100644 --- a/src/api-viewer/APIViewer.js +++ b/src/api-viewer/APIViewer.js @@ -242,6 +242,10 @@ Ext.onReady(function () { }; let for_each_property = function (schema, callback, one_of_info) { + // schema can be empty in case of 'null'' + if (!schema) { + return; + } one_of_info ||= []; if (schema.properties) { -- 2.47.3