public function indexAction(Request $request)
{
$format = $this->negotiator->getBestFormat($request->headers->get('Accept'));
if ($format == 'html') {
$format = 'json';
}
$data = array();
foreach ($this->registry->all() as $definition) {
$data[$definition->getName() . '_url'] = $this->router->generate('lemon_rest_list', array('resource' => $definition->getName()), RouterInterface::ABSOLUTE_URL);
}
$output = $this->serializer->serialize($data, $format);
$response = new Response();
$response->headers->set('Content-Type', $request->headers->get('Accept'));
$response->setContent($output);
return $response;
}