diff options
author | Francois Perrad <francois.perrad@gadz.org> | 2010-10-28 19:58:14 +0200 |
---|---|---|
committer | Francois Perrad <francois.perrad@gadz.org> | 2010-10-28 19:58:14 +0200 |
commit | e82733e8071e87f3f52fea617ced8d327efa3261 (patch) | |
tree | eb5242bc56a5d91b9c0baa5583c4b39ad5ba7f15 | |
parent | Github: rename some methods (diff) | |
download | api-description-e82733e8071e87f3f52fea617ced8d327efa3261.tar.gz |
spore2dot: add a detailed generation
-rw-r--r-- | utils/spore2dot.pl | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/utils/spore2dot.pl b/utils/spore2dot.pl index 034e8c7..7c11555 100644 --- a/utils/spore2dot.pl +++ b/utils/spore2dot.pl @@ -65,10 +65,30 @@ foreach my $spec (@specs) { print $_, "\\]"; $first = 0; } + if ($desc->{optional_payload}) { + print "\\["; + print ", " unless $first; + print "payload\\]"; + $first = 0; + } + if ($desc->{unattended_params} || $spec->{unattended_params}) { + print ", " unless $first; + print "..."; + } print ")"; print " ⊗" if $desc->{authentication} || $spec->{authentication}; print "\\l"; - print " ", $desc->{method}, " ", $desc->{path}, "\\l" if $ENV{SPORE_PATH}; + if ($ENV{SPORE_DETAILS}) { + print " ", $desc->{method}, " ", $desc->{path}, "\\l"; + for my $h (sort keys %{$desc->{headers}}) { + print " ", $h, ": ", $desc->{headers}->{$h}, "\\l"; + } + for my $f (sort keys %{$desc->{'form-data'}}) { + print " form-data \\\"", $f, "\\\" ", $desc->{'form-data'}->{$f}, "\\l"; + } + my $status = $desc->{expected_status} || $spec->{expected_status}; + print " ", join(', ', @{$status}), "\\l" if $status; + } } print "}\"];\n\n"; } |