]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/RESTHandler.pm
schema_get_type_text: do not always expand enums
[pve-common.git] / src / PVE / RESTHandler.pm
index 5e46dc3fb85097bb5c24193055a2aecf6aedf219..6fc69ad3c3af59567ee8959f5040e2d93e795c04 100644 (file)
@@ -417,7 +417,7 @@ sub handle {
 # $display_name: for example "-$name" of "<$name>", pass undef to use "$name:"
 # $phash: json schema property hash
 # $format: 'asciidoc', 'short', 'long' or 'full'
-# $style: 'config', 'arg' or 'fixed'
+# $style: 'config', 'config-sub', 'arg' or 'fixed'
 my $get_property_description = sub {
     my ($name, $style, $phash, $format, $hidepw, $fileparams) = @_;
 
@@ -434,7 +434,7 @@ my $get_property_description = sub {
 
     chomp $descr;
 
-    my $type = PVE::JSONSchema::schema_get_type_text($phash);
+    my $type = PVE::JSONSchema::schema_get_type_text($phash, $style);
 
     if ($hidepw && $name eq 'password') {
        $type = '';
@@ -443,7 +443,7 @@ my $get_property_description = sub {
     if ($fileparams && $type eq 'string') {
        foreach my $elem (@$fileparams) {
            if ($name eq $elem) {
-               $type = 'filepath';
+               $type = '<filepath>';
                last;
            }
        }
@@ -458,7 +458,7 @@ my $get_property_description = sub {
        } elsif ($style eq 'arg') {
            $res .= "`-$name` ";
        } elsif ($style eq 'fixed') {
-           $res .= "`<$name>` ";
+           $res .= "`<$name>`: ";
        } else {
            die "unknown style '$style'";
        }
@@ -466,7 +466,7 @@ my $get_property_description = sub {
        $res .= "`$type` " if $type;
 
        if (defined(my $dv = $phash->{default})) {
-           $res .= "(default=`$dv`)";
+           $res .= "('default =' `$dv`)";
        }
 
        if ($style eq 'config-sub') {