public function processRoute($route, $bindings = [], $headers = [], $withResponse = true)
{
$content = '';
$routeAction = $route->getAction();
$routeGroup = $this->getRouteGroup($routeAction['uses']);
$routeDescription = $this->getRouteDescription($routeAction['uses']);
if ($withResponse) {
$response = $this->getRouteResponse($route, $bindings, $headers);
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(['id' => md5($route->getUri() . ':' . implode($route->getMethods())), 'resource' => $routeGroup, 'title' => $routeDescription['short'], 'description' => $routeDescription['long'], 'methods' => $route->getMethods(), 'uri' => $route->getUri(), 'parameters' => [], 'response' => $content], $routeAction, $bindings);
}