getAttribute('type'); if ($type == 'specs') { $json = json_decode(file_get_contents($this->rootDir . '/docs/admin-openapi.json')); $uri = $request->getUri(); $uri = $uri->withPath('/admin/api'); $json->servers[0] = (object) [ 'url' => (string) $uri, 'description' => 'Production server' ]; return new JsonResponse($json); } return new ViewResponse( '/templates/app/api.twig', [ 'specs' => '/admin/api-specs' ] ); } }