public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH widget-toolkit] api-viewer: fix handling of 'null' return schema
@ 2026-09-18 11:56 Dominik Csapak
  2026-09-18 12:08 ` applied: " Fabian Grünbichler
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2026-09-18 11:56 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-18 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-18 11:56 [PATCH widget-toolkit] api-viewer: fix handling of 'null' return schema Dominik Csapak
2026-09-18 12:08 ` applied: " Fabian Grünbichler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal