src/Statistic/Controller/StatisticController.php
public function get($alias)
    {
        $alias = str_replace('/', '.', $alias);

        try {
            $datum = $this->statisticService->get($alias);
        } catch (InvalidAliasException $exception) {
            throw new NotFoundHttpException('Statistic alias not found.', $exception);
        }

        $data = $datum->toObject();
        $data->timestamp = $data->timestamp->format(static::TIMESTAMP_FORMAT);
        unset($data->alias);

        return new JsonResponse($data, Response::HTTP_OK, [
            'Content-Type' => 'application/json; charset=utf-8'
        ]);
    }
public function get($alias)
    {
        $alias = str_replace('/', '.', $alias);

        try {
            $datum = $this->statisticService->get($alias);
        } catch (InvalidAliasException $exception) {
            throw new NotFoundHttpException('Statistic alias not found.', $exception);
        }

        $data = $datum->toObject();
        $data->timestamp = $data->timestamp->format(static::TIMESTAMP_FORMAT);
        unset($data->alias);

        return new JsonResponse($data, Response::HTTP_OK, [
            'Content-Type' => 'application/json; charset=utf-8'
        ]);
    }
Action

@Route(path="/statistics/{alias}", requirements={"alias"=".+"}, methods={"GET"})
@Security("is_granted('READ', 'statistic')")
@param string $alias
@return \Symfony\Component\HttpFoundation\JsonResponse