public function explainAction($actionName, $format)
    {
        $adapter = $this->getAdapter($format);
        $action = $this->getExecutor($actionName);

        if (!$action->supports($format)) {
            throw new \Exception('This action is not supported for the '.$format.' format.');
        }

        $schema = $action->getSchema();

        if (array_key_exists('$root', $schema)) {
            $jsonSchema = $this->serializer->getSchema($schema['$root']);

            if ($jsonSchema) {
                return $adapter->explainSchema($jsonSchema, $action->getMode());
            }
        }

        $identifiersSchema = [];

        foreach ($schema as $prop => $value) {
            if ($this->serializer->has($value)) {
                $identifiersSchema[$prop] = $this->serializer->getSchema($value);
            } else {
                $identifiersSchema[$prop] = $value;
            }
        }

        return $adapter->explainIdentifiers($identifiersSchema);
    }
public function explainAction($actionName, $format)
    {
        $adapter = $this->getAdapter($format);
        $action = $this->getExecutor($actionName);

        if (!$action->supports($format)) {
            throw new \Exception('This action is not supported for the '.$format.' format.');
        }

        $schema = $action->getSchema();

        if (array_key_exists('$root', $schema)) {
            $jsonSchema = $this->serializer->getSchema($schema['$root']);

            if ($jsonSchema) {
                return $adapter->explainSchema($jsonSchema, $action->getMode());
            }
        }

        $identifiersSchema = [];

        foreach ($schema as $prop => $value) {
            if ($this->serializer->has($value)) {
                $identifiersSchema[$prop] = $this->serializer->getSchema($value);
            } else {
                $identifiersSchema[$prop] = $value;
            }
        }

        return $adapter->explainIdentifiers($identifiersSchema);
    }
public function explainAction ( $ actionName , $ format ) { $ adapter = $ this -> getAdapter ( $ format ) ; $ action = $ this -> getExecutor ( $ actionName ) ; if ( ! $ action -> supports ( $ format ) ) { throw new \ Exception ( 'This action is not supported for the ' . $ format . ' format.' ) ; } $ schema = $ action -> getSchema ( ) ; if ( array_key_exists ( '$root' , $ schema ) ) { $ jsonSchema = $ this -> serializer -> getSchema ( $ schema [ '$root' ] ) ; if ( $ jsonSchema ) { return $ adapter -> explainSchema ( $ jsonSchema , $ action -> getMode ( ) ) ; } } $ identifiersSchema = [ ] ; foreach ( $ schema as $ prop => $ value ) { if ( $ this -> serializer -> has ( $ value ) ) { $ identifiersSchema [ $ prop ] = $ this -> serializer -> getSchema ( $ value ) ; } else { $ identifiersSchema [ $ prop ] = $ value ; } } return $ adapter -> explainIdentifiers ( $ identifiersSchema ) ; }
Returns the AbstractAction object for an given action.

@param string $actionName
@param string $format

@return mixed|array
Returns the AbstractAction object for an given action .