public function addSchemaValidation($schemaFile, $name = null)
    {
        $realName = $this->generateName($schemaFile, $name);
        $realPath = getcwd() . DIRECTORY_SEPARATOR . $schemaFile;

        if (file_exists($realPath)) {
            if (!key_exists($realName, $this->schemaValidations)) {
                // TODO can we do it better?
                if ($this->devMode || (!$this->isSerialized($realPath) && !$this->devMode)) {
                    $json = json_decode(file_get_contents($realPath), true);
                    if (is_null($json)) {
                        trigger_error($schemaFile . ' is not a valid json file', E_USER_ERROR);
                    }

                    $validation = $this->createValidation($json);

                    if (!$this->devMode) {
                        file_put_contents($realPath . '.ser', serialize($validation));
                    }

                    $this->schemaValidations[$realName] = $validation;
                } else {
                    $this->schemaValidations[$realName] = unserialize(file_get_contents($realPath . '.ser'));
                }
            } else {
                trigger_error('Schema with the name ' . $realName . ' already exist.', E_USER_ERROR);
            }
        } else {
            trigger_error($schemaFile . ' could not be found', E_USER_ERROR);
        }
    }