get schema info

@param Request $request request

@return Response
138
public function schemaAction(Request $request)
    {
        $api = $this->decideApiAndEndpoint($request->getUri());
        $this->registerProxySources($api['apiName']);
        $this->apiLoader->addOptions($api);

        $schema = $this->apiLoader->getEndpointSchema(urldecode($api['endpoint']));
        $schema = $this->transformationHandler->transformSchema(
            $api['apiName'],
            $api['endpoint'],
            $schema,
            clone $schema
        );
        $response = new Response(json_encode($schema), 200);
        $response->headers->set('Content-Type', 'application/json');

        return $this->templating->renderResponse(
            'GravitonCoreBundle:Main:index.json.twig',
            array ('response' => $response->getContent()),
            $response
        );
    }
28258
private function getSchema($uri)
    {
        if (empty($this->schemas[$uri])) {
            $this->schemas[$uri] = Utils::loadJsonFromFile($this->uriToFile($uri));
        }

        return $this->schemas[$uri];
    }
325561
public function packageInfo(Request $request)
    {
        $packageName = $request->get('package');
        $reqVersion = $request->get('version');

        try {
            $response = $this->manager()->showPackage('installed', $packageName, $reqVersion);
        } catch (\Exception $e) {
            return $this->getJsonException($e);
        }

        if (isset($response[$packageName]['package'])) {
            /** @var PackageInterface $package */
            $package = $response[$packageName]['package'];

            return $this->json([
                'name'    => $packageName,
                'version' => $package->getPrettyVersion(),
                'type'    => $package->getType(),
            ]);
        }

        return $this->getJsonException(new PackageManagerException(Trans::__('page.extend.message.package-install-info-fail', ['%PACKAGE%' => $packageName, '%VERSION%' => $reqVersion])));
    }
1133386
public function getActionAlias(Request $request): string
    {
        $actionAlias = str_replace('/', ':', $request->query->get('route'));

        if (empty($actionAlias)) {
            return $this->getConfiguration()->getDefaultController() . ':' . $this->getConfiguration()->getDefaultAction();
        }

        if (!strpos($actionAlias, ':')) {
            return $actionAlias . ':' . $this->getConfiguration()->getDefaultAction();
        }

        $aliases = array_keys($this->getQueryMap([]));

        foreach ($aliases as $alias) {
            if (strtolower($alias) === strtolower($actionAlias)) {
                $actionAlias = $alias;

                break;
            }
        }

        return $actionAlias;
    }
884039
protected function extractQueryFilter(Request $request)
    {
        return array_map(
            function ($value) {
                return array_filter(explode(',', trim($value, ',')), function ($var) {
                    return !empty($var);
                });
            },
            $request->query->all()
        );
    }
799883
public function fieldsAction(Request $request)
    {
        $locale = $this->getLocale($request);

        $context = $request->get('context');

        if ($context === 'order') {
            $descriptors = array_values($this->getManager()->getFieldDescriptors($locale, $context));
        } else {
            $descriptors = array_values($this->getManager()->getFieldDescriptors($locale));
        }

        // default contacts list
        return $this->handleView($this->view($descriptors), 200);
    }
201558
public function setRequest(Request $request)
    {
        $context = (new RequestContext())->fromRequest($request);

        $this->cachedRoot = null;
        $this->cachedSchema = null;
        return $this->setContext($context);
    }
1110493
public function findByRequest(Request $request)
    {
        $qb = $this->createQueryBuilder('s');

        if ($request->get('attribute')) {
            $qb->join('s.allowedInAttributes', 'a')
                ->andWhere('a.id = :attributeId')
                ->setParameter('attributeId', $request->get('attribute'));
        }

        return $qb->getQuery()->getArrayResult();
    }
94424
public static function getHeadersFromRequest(Request $request)
    {
        $headers = array();
        foreach($request->headers as $key => $value)
        {
            if(isset($key) && isset($value) && isset($value[0]))
            {
                $headers[$key] = $value[0];
            }
        }
        return $headers;
    }
989759
public function cgetAction(Request $request)
    {
        $locale = $this->getLocale($request);

        // if the type parameter is falsy, assign NULL to $type
        $type = $request->query->get('type', null) ?: null;

        $idsString = $request->get('ids');

        if ($idsString) {
            $ids = explode(',', $idsString);
            $snippets = $this->snippetRepository->getSnippetsByUuids($ids, $locale);
            $total = count($snippets);
        } else {
            $snippets = $this->snippetRepository->getSnippets(
                $locale,
                $type,
                $this->listRestHelper->getOffset(),
                $this->listRestHelper->getLimit(),
                $this->listRestHelper->getSearchPattern(),
                $this->listRestHelper->getSortColumn(),
                $this->listRestHelper->getSortOrder()
            );

            $total = $this->snippetRepository->getSnippetsAmount(
                $locale,
                $type,
                $this->listRestHelper->getSearchPattern(),
                $this->listRestHelper->getSortColumn(),
                $this->listRestHelper->getSortOrder()
            );
        }

        $data = new ListRepresentation(
            $snippets,
            'snippets',
            'get_snippets',
            $request->query->all(),
            $this->listRestHelper->getPage(),
            $this->listRestHelper->getLimit(),
            $total
        );

        return $this->viewHandler->handle(View::create($data));
    }
350665
protected function getTermData(Request $request)
    {
        $data = [];

        foreach ($this->repository as $field) {
            $data[$field->getName()] = $request->get($field->getName());
        }

        return $data;
    }
937750
protected function getFormEntity(Request $request)
    {
        if ($this->formEntity === null) {
            $entityId = $request->get('id');
            $repository = $this->getRepository();
            $entity = null;
            $id = 0;

            if (!empty($entityId) && $entityId !== null) {
                $entity = $repository->findOneById($entityId);
                $id = $entity->getId();
            }

            if (!is_object($entity) || empty($id)) {
                // new form, return empty entity
                $entity_class_name = $repository->getClassName();
                $entity = new $entity_class_name();
            }

            $this->formEntity = $entity;
        }

        return $this->formEntity;
    }
273747
public function getInvTypes(Request $request)
    {

        return response()->json([
            'results' => DB::table('invTypes')
                ->select('typeName as id', 'typeName as text')
                ->where('typeName', 'like', '%' . $request->q . '%')->get(),
        ]);

    }
1232006
public function typenodeAction(Request $request)
    {
        $types = $this->get("ydle.nodetype.manager")->findAllByName();
        $sensorType = new NodeType();

        // Manage edition mode
        $this->currentType = $request->get('type');
        if ($this->currentType) {
            $sensorType = $this->get("ydle.nodetype.manager")->find($request->get('type'));
        }
        $form = $this->createForm("nodetypes_form", $sensorType);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($sensorType);
            $em->flush();
            $message = 'Type de capteur ajoutée avec succès';
            if ($sensorType->getId()) {
                $message = 'Type de capteur modifié avec succès';
            }
            $this->get('session')->getFlashBag()->add('notice', $message);

            return $this->redirect($this->generateUrl('configTypeSensor'));
        }

        return $this->render('YdleHubBundle:Config:typenode.html.twig', array(
            'form' => $form->createView(),
            'current' => 'typesensor',
            'mainpage' => 'config',
            'items' => $types
        ));
    }
1283509
public function store(Request $request)
    {
        $this->manager->resetPath($request->folder);

        if (empty($request->name)) {
            return $this->json('Name property is required.', 422);
        }

        if (!$this->manager->blobExists()) {
            return $this->json('Folder not found.', 404);
        }

        $result = $this->manager->makeDirectory($request->name)->fullDetails();

        return $this->json($result);
    }
823694
public function getSchema()
    {
        $schemaLocation = $this->documentElement->getAttribute('xsi:schemaLocation');
        if (!$schemaLocation or strpos($schemaLocation, ' ')===false)
            return false;
        list($uri, $xsd) = explode(' ', $schemaLocation);
        return $xsd;
    }
1060023
private function getRequestOptions(Request $request)
    {
        $options = [
            'http_errors' => false,
            'synchronous' => true
        ];

        if ($request->getQuery()) {
            $options['query'] = array_merge($this->getDefaultQuery(), $request->getQuery());
        } else {
            $options['query'] = $this->getDefaultQuery();
        }
        if ($request->getParams())
            $options['json'] = $request->getParams();

        return $options;
    }