Skip to content

Commit

Permalink
added formats to swagger spec (see #228)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Duggan committed Aug 19, 2015
1 parent 12ee967 commit bc7ac51
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/Tuba/Doc.pm
Expand Up @@ -104,7 +104,6 @@ sub api_reference {
$c->stash(placeholders => \@placeholders);
}
);

}

1;
Expand Down
8 changes: 7 additions & 1 deletion lib/Tuba/DocManager.pm
Expand Up @@ -251,6 +251,7 @@ sub find_doc {
note => $entry->{note},
tags => $entry->{tags},
response_headers => $entry->{response_headers},
formats => $entry->{formats},
);
}

Expand Down Expand Up @@ -308,6 +309,11 @@ sub _show_defaults {
return (
brief => "Get a representation of $an $phrase.",
description => "Get JSON which represents the structure of $an $phrase.",
formats => [
'application/json', 'application/x-turtle', 'text/turtle',
'application/n-triples', 'text/n3', 'text/rdf+n3', 'application/ld+json',
'application/rdf+xml', 'application/rdf+json',
],
$a{withs} ?
(
params => [
Expand Down Expand Up @@ -394,7 +400,7 @@ sub _walk_routes {
headers => $doc->response_headers || {}
}
},
produces => [ "application/json" ],
produces => $doc->formats || [ "application/json" ],
tags => $doc->tags || [ "misc" ],
( parameters => \@params ) x !!@params,
}
Expand Down
1 change: 1 addition & 0 deletions lib/Tuba/RouteDoc.pm
Expand Up @@ -14,6 +14,7 @@ has 'params';
has 'note';
has 'tags';
has 'response_headers';
has 'formats';

1;

0 comments on commit bc7ac51

Please sign in to comment.