X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FPodParser.pm;fp=src%2FPVE%2FPodParser.pm;h=8ad05980f71ea63f1a28ca99b703db63d45028c6;hp=f61317bca69666990f8a2248edb7d75d8df0d3e3;hb=7b1e4b04b2afd171e840bebde194735629608215;hpb=6a4950944d3cde652ea774b53f9924c31ed0043c diff --git a/src/PVE/PodParser.pm b/src/PVE/PodParser.pm index f61317b..8ad0598 100644 --- a/src/PVE/PodParser.pm +++ b/src/PVE/PodParser.pm @@ -120,6 +120,19 @@ sub schema_get_type_text { return $type; } +sub generate_property_text { + my ($schema) = @_; + my $data = ''; + foreach my $key (sort keys %$schema) { + my $d = $schema->{$key}; + my $desc = $d->{description}; + my $typetext = schema_get_type_text($d); + $desc = 'No description available' if !$desc; + $data .= "=item $key: $typetext\n\n$desc\n\n"; + } + return $data; +} + # generta epop from JSON schema properties sub dump_properties { my ($properties) = @_; @@ -150,6 +163,15 @@ sub dump_properties { my $typetext = schema_get_type_text($d); $data .= "=item $base: $typetext\n\n"; $data .= "$descr\n\n"; + + if ($d->{type} eq 'string') { + my $format = $d->{format}; + if ($format && ref($format) eq 'HASH') { + $data .= "=over 1.1\n\n"; + $data .= generate_property_text($format); + $data .= "=back\n\n"; + } + } } $data .= "=back";