src/Graviton/RestBundle/Routing/Loader/ActionUtils.php
public static function getCanonicalSchemaRoute($service, $serviceConfig, $type = 'item', $option = false)
    {
        $pattern = self::getBaseFromService($service, $serviceConfig);
        $pattern = '/schema' . $pattern . $type;

        $action = 'schemaAction';
        $method = 'GET';
        if ($option !== false) {
            $action = 'optionsAction';
            $method = 'OPTIONS';
        }

        $defaults = array(
            '_controller' => $service . ':' . $action,
            '_format' => '~',
        );

        $route = new Route($pattern, $defaults, []);
        $route->setMethods($method);

        return $route;
    }
public static function getCanonicalSchemaRoute($service, $serviceConfig, $type = 'item', $option = false)
    {
        $pattern = self::getBaseFromService($service, $serviceConfig);
        $pattern = '/schema' . $pattern . $type;

        $action = 'schemaAction';
        $method = 'GET';
        if ($option !== false) {
            $action = 'optionsAction';
            $method = 'OPTIONS';
        }

        $defaults = array(
            '_controller' => $service . ':' . $action,
            '_format' => '~',
        );

        $route = new Route($pattern, $defaults, []);
        $route->setMethods($method);

        return $route;
    }
public static function getCanonicalSchemaRoute ( $ service , $ serviceConfig , $ type = 'item' , $ option = false ) { $ pattern = self :: getBaseFromService ( $ service , $ serviceConfig ) ; $ pattern = '/schema' . $ pattern . $ type ; $ action = 'schemaAction' ; $ method = 'GET' ; if ( $ option !== false ) { $ action = 'optionsAction' ; $ method = 'OPTIONS' ; } $ defaults = array ( '_controller' => $ service . ':' . $ action , '_format' => '~' , ) ; $ route = new Route ( $ pattern , $ defaults , [ ] ) ; $ route -> setMethods ( $ method ) ; return $ route ; }
Get canonical route for schema requests

@param string  $service       service id
@param array   $serviceConfig service configuration
@param string  $type          service type (item or collection)
@param boolean $option        render a options route

@return Route
Get canonical route for schema requests