all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pve-common] json schema: display nested oneOf error messages
@ 2026-06-05 15:42 Erik Fastermann
  2026-06-09 21:58 ` applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Erik Fastermann @ 2026-06-05 15:42 UTC (permalink / raw)
  To: pve-devel; +Cc: Erik Fastermann

Correctly display the error message for each oneOf case, not just the
empty string, which was caused by the wrong key being used in the hash
lookup.

Signed-off-by: Erik Fastermann <e.fastermann@proxmox.com>
---
 src/PVE/JSONSchema.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm
index 1997c70..fd10338 100644
--- a/src/PVE/JSONSchema.pm
+++ b/src/PVE/JSONSchema.pm
@@ -1409,13 +1409,13 @@ sub check_prop {
                 }
 
                 for my $inner_path (keys $inner_errors->%*) {
-                    add_error($collected_errors, $inner_path, $inner_errors->{$path});
+                    add_error($collected_errors, $inner_path, $inner_errors->{$inner_path});
                 }
             }
 
             if (!$is_valid) {
                 for my $inner_path (keys $collected_errors->%*) {
-                    add_error($errors, $inner_path, $collected_errors->{$path});
+                    add_error($errors, $inner_path, $collected_errors->{$inner_path});
                 }
             }
         }
-- 
2.47.3




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

end of thread, other threads:[~2026-06-09 21:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-05 15:42 [PATCH pve-common] json schema: display nested oneOf error messages Erik Fastermann
2026-06-09 21:58 ` applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal