src/Graviton/RestBundle/Service/RestUtils.php
public function validateRequest($content, DocumentModel $model)
    {
        $errors = $this->validateContent($content, $model);
        if (!empty($errors)) {
            throw new ValidationException($errors);
        }
        return $this->deserialize($content, $model->getEntityClass());
    }
public function validateRequest($content, DocumentModel $model)
    {
        $errors = $this->validateContent($content, $model);
        if (!empty($errors)) {
            throw new ValidationException($errors);
        }
        return $this->deserialize($content, $model->getEntityClass());
    }
public function validateRequest ( $ content , DocumentModel $ model ) { $ errors = $ this -> validateContent ( $ content , $ model ) ; if ( ! empty ( $ errors ) ) { throw new ValidationException ( $ errors ) ; } return $ this -> deserialize ( $ content , $ model -> getEntityClass ( ) ) ; }
Validates the current request on schema violations. If there are errors,
the exception is thrown. If not, the deserialized record is returned.

@param object|string $content \stdClass of the request content
@param DocumentModel $model   the model to check the schema for

@return ValidationExceptionError|Object
@throws \Exception
Validates the current request on schema violations . If there are errors the exception is thrown . If not the deserialized record is returned .