about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrancois Perrad <francois.perrad@gadz.org>2010-10-28 19:58:14 +0200
committerFrancois Perrad <francois.perrad@gadz.org>2010-10-28 19:58:14 +0200
commite82733e8071e87f3f52fea617ced8d327efa3261 (patch)
treeeb5242bc56a5d91b9c0baa5583c4b39ad5ba7f15
parentGithub: rename some methods (diff)
downloadapi-description-e82733e8071e87f3f52fea617ced8d327efa3261.tar.gz
spore2dot: add a detailed generation
-rw-r--r--utils/spore2dot.pl22
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 " &otimes;" if $desc->{authentication} || $spec->{authentication};
         print "\\l";
-        print "&nbsp;&nbsp;&nbsp;", $desc->{method}, " ", $desc->{path}, "\\l" if $ENV{SPORE_PATH};
+        if ($ENV{SPORE_DETAILS}) {
+            print "&nbsp;&nbsp;&nbsp;", $desc->{method}, " ", $desc->{path}, "\\l";
+            for my $h (sort keys %{$desc->{headers}}) {
+                print "&nbsp;&nbsp;&nbsp;", $h, ": ", $desc->{headers}->{$h}, "\\l";
+            }
+            for my $f (sort keys %{$desc->{'form-data'}}) {
+                print "&nbsp;&nbsp;&nbsp;form-data \\\"", $f, "\\\" ", $desc->{'form-data'}->{$f}, "\\l";
+            }
+            my $status = $desc->{expected_status} || $spec->{expected_status};
+            print "&nbsp;&nbsp;&nbsp;", join(', ', @{$status}), "\\l" if $status;
+        }
     }
     print "}\"];\n\n";
 }