Nit: the title could mention that it fixes an existing issue, e.g.
"fix displaying ..."

Am 29.05.26 um 2:58 PM schrieb Erik Fastermann:
> Correctly display the error message for each oneOf case, not just the
> empty string.

Nit: you could elaborate slightly more, saying that it ended up being
the empty string, because the wrong key was used when doing the hash lookup.

For completeness, it could have a
Fixes: 9425834 ("json schema: implement 'oneOf' schema")
tag.

> 
> Signed-off-by: Erik Fastermann <[email protected]>
> ---
>  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->%*) {

pre-existing, but we could add a sort here for consistency (in its own
patch)

> -                    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->%*) {

same here (in the same separate patch)

> -                    add_error($errors, $inner_path, 
> $collected_errors->{$path});
> +                    add_error($errors, $inner_path, 
> $collected_errors->{$inner_path});
>                  }
>              }
>          }




Reply via email to