public function validate($schema, $json)
    {
        $validator = new Validator;

        $validator->check($json, $schema);

        if (false === $validator->isValid()) {
            $errors = array();

            foreach ($validator->getErrors() as $error) {
                $errors[] = (empty($error['property']) ? '' : $error['property'] . ': ')
                          . $error['message'];
            }

            throw JSONException::errors($errors);
        }
    }