diff --git a/composer.json b/composer.json index e2161b9..c6fd28a 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/src/templates/api_docu_matched.latte b/src/templates/api_docu_matched.latte index 6fa3cfb..b02e4f5 100644 --- a/src/templates/api_docu_matched.latte +++ b/src/templates/api_docu_matched.latte @@ -74,6 +74,22 @@ + {if !empty($route->getResponseCodes())} +

Response codes

+ +

+ {foreach $route->getResponseCodes() as $code => $description} + {if is_string($description)} + {$code} ({$description}) +
+ {else} + {$description} +
+ {/if} + {/foreach} +

+ {/if} +

Query parameters

diff --git a/src/templates/api_docu_one.latte b/src/templates/api_docu_one.latte index 40386fd..af1fc83 100644 --- a/src/templates/api_docu_one.latte +++ b/src/templates/api_docu_one.latte @@ -61,6 +61,22 @@
+ {if !empty($route->getResponseCodes())} +

Response codes

+ +

+ {foreach $route->getResponseCodes() as $code => $description} + {if is_string($description)} + {$code} ({$description}) +
+ {else} + {$description} +
+ {/if} + {/foreach} +

+ {/if} + {if $route->getExample()}

Example response

{json_encode($route->getExample(), JSON_PRETTY_PRINT)}