description => "Do not show column headers (for 'text' format).",
type => 'boolean',
optional => 1,
- default => 1,
+ default => 0,
},
noborder => {
description => "Do not draw borders (for 'text' format).",
type => 'boolean',
optional => 1,
- default => 1,
+ default => 0,
},
quiet => {
description => "Suppress printing results.",
};
sub api_clone_schema {
- my ($schema) = @_;
+ my ($schema, $no_typetext) = @_;
my $res = {};
my $ref = ref($schema);
my $tmp = ref($pd) ? clone($pd) : $pd;
# NOTE: add typetext property for more complex types, to
# make the web api viewer code simpler
- if (!(defined($tmp->{enum}) || defined($tmp->{pattern}))) {
+ if (!$no_typetext && !(defined($tmp->{enum}) || defined($tmp->{pattern}))) {
my $typetext = PVE::JSONSchema::schema_get_type_text($tmp);
if ($tmp->{type} && ($tmp->{type} ne $typetext)) {
$tmp->{typetext} = $typetext;
} else {
if ($k eq 'parameters') {
$data->{$k} = api_clone_schema($d);
+ } elsif ($k eq 'returns') {
+ $data->{$k} = api_clone_schema($d, 1);
} else {
$data->{$k} = ref($d) ? clone($d) : $d;
}
}
}
+ # also remove $standard_output_options from $prop (pvesh, pveclient)
+ if ($prop->{'output-format'}) {
+ $has_output_format_option = 1;
+ foreach my $key (keys %$prop) {
+ if ($standard_output_options->{$key}) {
+ delete $prop->{$key};
+ }
+ }
+ }
+
my $out = '';
my $arg_hash = {};