Controller/DocumentationGeneratorController.php
public function getContextAction($type)
    {
        $context = $this->get('hydra.api')->getContext($type);

        if (null === $context) {
            $this->createNotFoundException();
        }

        return new JsonLdResponse($context);
    }
public function getContextAction($type)
    {
        $context = $this->get('hydra.api')->getContext($type);

        if (null === $context) {
            $this->createNotFoundException();
        }

        return new JsonLdResponse($context);
    }
Generates the service documentation

@Route("/contexts/{type}.jsonld", defaults = { "_format" = "jsonld" }, name="hydra_context")