From: Dominik Csapak <d.csapak@proxmox.com>
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 [thread overview]
Message-ID: <20260918115750.3653121-1-d.csapak@proxmox.com> (raw)
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 <d.csapak@proxmox.com>
---
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
next reply other threads:[~2026-09-18 11:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 11:56 Dominik Csapak [this message]
2026-09-18 12:08 ` applied: [PATCH widget-toolkit] api-viewer: fix handling of 'null' return schema Fabian Grünbichler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260918115750.3653121-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox