src/Graviton/RestBundle/Service/RestUtils.php
public function validateContent($content, DocumentModel $model)
    {
        if (is_string($content)) {
            $content = json_decode($content);
        }

        return $this->schemaValidator->validate(
            $content,
            $this->schemaUtils->getModelSchema(null, $model, true, true, true, $content)
        );
    }
public function validateContent($content, DocumentModel $model)
    {
        if (is_string($content)) {
            $content = json_decode($content);
        }

        return $this->schemaValidator->validate(
            $content,
            $this->schemaUtils->getModelSchema(null, $model, true, true, true, $content)
        );
    }
public function validateContent ( $ content , DocumentModel $ model ) { if ( is_string ( $ content ) ) { $ content = json_decode ( $ content ) ; } return $ this -> schemaValidator -> validate ( $ content , $ this -> schemaUtils -> getModelSchema ( null , $ model , true , true , true , $ content ) ) ; }
Validates content with the given schema, returning an array of errors.
If all is good, you will receive an empty array.

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

@return \Graviton\JsonSchemaBundle\Exception\ValidationExceptionError[]
@throws \Exception
Validates content with the given schema returning an array of errors . If all is good you will receive an empty array .