Skip to content

Commit

Permalink
Added section Response codes
Browse files Browse the repository at this point in the history
  • Loading branch information
paveljanda committed Jul 31, 2016
1 parent e16ee63 commit 0cabc33
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"nette/application" : "^2.3|^2.4",
"nette/di" : "^2.3|^2.4",
"latte/latte" : "^2.3|^2.4",
"ublaboo/api-router" : "~1.2"
"ublaboo/api-router" : ">=1.2.5"
},
"require-dev": {
"nette/tester" : "~1.6.1",
Expand Down
16 changes: 16 additions & 0 deletions src/templates/api_docu_matched.latte
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@
</table>
</div>

{if !empty($route->getResponseCodes())}
<h2>Response codes</h2>

<p class="apiDocu-description">
{foreach $route->getResponseCodes() as $code => $description}
{if is_string($description)}
{$code} <small>({$description})</small>
<br>
{else}
{$description}
<br>
{/if}
{/foreach}
</p>
{/if}

<div class="apiDocu-parameters" n:if="$query_parameters">
<h2>Query parameters</h2>

Expand Down
16 changes: 16 additions & 0 deletions src/templates/api_docu_one.latte
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@
</table>
</div>

{if !empty($route->getResponseCodes())}
<h2>Response codes</h2>

<p class="apiDocu-description">
{foreach $route->getResponseCodes() as $code => $description}
{if is_string($description)}
{$code} <small>({$description})</small>
<br>
{else}
{$description}
<br>
{/if}
{/foreach}
</p>
{/if}

{if $route->getExample()}
<h2>Example response</h2>
<pre class="apiDocu-parameters-box">{json_encode($route->getExample(), JSON_PRETTY_PRINT)}</pre>
Expand Down

0 comments on commit 0cabc33

Please sign in to comment.