From e82733e8071e87f3f52fea617ced8d327efa3261 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Thu, 28 Oct 2010 19:58:14 +0200 Subject: spore2dot: add a detailed generation --- utils/spore2dot.pl | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'utils') 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"; } -- cgit v1.2.3 From 84ad429dc79644573cccb6c842f200b2c8828a29 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sun, 31 Oct 2010 10:01:18 +0100 Subject: spore2dot: add note --- utils/spore2dot.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'utils') diff --git a/utils/spore2dot.pl b/utils/spore2dot.pl index 7c11555..63d15a8 100644 --- a/utils/spore2dot.pl +++ b/utils/spore2dot.pl @@ -77,6 +77,7 @@ foreach my $spec (@specs) { } print ")"; print " ⊗" if $desc->{authentication} || $spec->{authentication}; + print " DEPRECATED" if $desc->{deprecated}; print "\\l"; if ($ENV{SPORE_DETAILS}) { print "   ", $desc->{method}, " ", $desc->{path}, "\\l"; @@ -91,6 +92,16 @@ foreach my $spec (@specs) { } } print "}\"];\n\n"; + + my $note = $spec->{description} || $spec->{meta}->{documentation}; + if ($note && $ENV{SPORE_NOTES}) { + $note =~ s/\n/\\n/g; + print " \"__note__", $name, "\"\n"; + print " [label=\"", $note, "\" shape=note];\n\n"; + + print " \"", $name, "\" -> \"__note__", $name, "\"\n"; + print " [arrowhead = none, arrowtail = none, style = dashed];\n\n"; + } } print "}\n"; -- cgit v1.2.3 From dd7b7bbc243bfbaaaae33f48b2423f047b9b0572 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Mon, 1 Nov 2010 14:51:38 +0100 Subject: spore2dot: split note & doc --- utils/spore2dot.pl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/spore2dot.pl b/utils/spore2dot.pl index 63d15a8..f7e0e7e 100644 --- a/utils/spore2dot.pl +++ b/utils/spore2dot.pl @@ -93,7 +93,7 @@ foreach my $spec (@specs) { } print "}\"];\n\n"; - my $note = $spec->{description} || $spec->{meta}->{documentation}; + my $note = $spec->{description}; if ($note && $ENV{SPORE_NOTES}) { $note =~ s/\n/\\n/g; print " \"__note__", $name, "\"\n"; @@ -102,6 +102,15 @@ foreach my $spec (@specs) { print " \"", $name, "\" -> \"__note__", $name, "\"\n"; print " [arrowhead = none, arrowtail = none, style = dashed];\n\n"; } + my $doc = $spec->{meta}->{documentation}; + if ($doc && $ENV{SPORE_NOTES}) { + $doc =~ s/\n/\\n/g; + print " \"__doc__", $name, "\"\n"; + print " [label=\"", $doc, "\" shape=note];\n\n"; + + print " \"", $name, "\" -> \"__doc__", $name, "\"\n"; + print " [arrowhead = none, arrowtail = none, style = dashed];\n\n"; + } } print "}\n"; -- cgit v1.2.3