Skip to content

Commit

Permalink
Fixes issue #83
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot committed Aug 22, 2016
1 parent 6c2954d commit 7174737
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Mpociot/ApiDoc/Generators/LaravelGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ protected function getUri($route)
*/
public function processRoute($route, $bindings = [], $withResponse = true)
{
$response = '';

if ($withResponse) {
$response = $this->getRouteResponse($route, $bindings);
}
$content = '';

$routeAction = $route->getAction();
$routeGroup = $this->getRouteGroup($routeAction['uses']);
$routeDescription = $this->getRouteDescription($routeAction['uses']);

if ($response->headers->get('Content-Type') === 'application/json') {
$content = json_encode(json_decode($response->getContent()), JSON_PRETTY_PRINT);
} else {
$content = $response->getContent();

if ($withResponse) {
$response = $this->getRouteResponse($route, $bindings);
if ($response->headers->get('Content-Type') === 'application/json') {
$content = json_encode(json_decode($response->getContent()), JSON_PRETTY_PRINT);
} else {
$content = $response->getContent();
}
}

return $this->getParameters([
Expand Down

0 comments on commit 7174737

Please sign in to comment.