Example #1
0
 def _validate_smev_element(self, element):
     self._smev_schema = self._smev_schema or _utils.load_schema(
         self._smev_schema_path)
     if not self._smev_schema.validate(element):
         errors = "\n".join(
             (err.message for err in self._smev_schema.error_log))
         raise _Fault(
             "SMEV-102000", "Message didn't pass validation checks!"
             " Errors:\n{0}".format(errors))
Example #2
0
 def _validate_smev_element(self, element):
     self._smev_schema = self._smev_schema or _utils.load_schema(
         self._smev_schema_path)
     if not self._smev_schema.validate(element):
         errors = "\n".join((
             err.message for err in self._smev_schema.error_log))
         raise _Fault(
             "SMEV-102000",
             "Message didn't pass validation checks!"
             " Errors:\n{0}".format(errors))
Example #3
0
    return Validator


def extend(validator, validators, version=None):
    all_validators = dict(validator.VALIDATORS)
    all_validators.update(validators)
    return create(
        meta_schema=validator.META_SCHEMA,
        validators=all_validators,
        version=version,
        default_types=validator.DEFAULT_TYPES,
    )


Draft3Validator = create(
    meta_schema=_utils.load_schema("draft3"),
    validators={
        "$ref" : _validators.ref,
        "additionalItems" : _validators.additionalItems,
        "additionalProperties" : _validators.additionalProperties,
        "dependencies" : _validators.dependencies,
        "disallow" : _validators.disallow_draft3,
        "divisibleBy" : _validators.multipleOf,
        "enum" : _validators.enum,
        "extends" : _validators.extends_draft3,
        "format" : _validators.format,
        "items" : _validators.items,
        "maxItems" : _validators.maxItems,
        "maxLength" : _validators.maxLength,
        "maximum" : _validators.maximum,
        "minItems" : _validators.minItems,
Example #4
0
    return Validator


def extend(validator, validators, version=None):
    all_validators = dict(validator.VALIDATORS)
    all_validators.update(validators)
    return create(
        meta_schema=validator.META_SCHEMA,
        validators=all_validators,
        version=version,
        default_types=validator.DEFAULT_TYPES,
    )


Draft3Validator = create(
    meta_schema=_utils.load_schema("draft3"),
    validators={
        u"$ref": _validators.ref,
        u"additionalItems": _validators.additionalItems,
        u"additionalProperties": _validators.additionalProperties,
        u"dependencies": _validators.dependencies,
        u"disallow": _validators.disallow_draft3,
        u"divisibleBy": _validators.multipleOf,
        u"enum": _validators.enum,
        u"extends": _validators.extends_draft3,
        u"format": _validators.format,
        u"items": _validators.items,
        u"maxItems": _validators.maxItems,
        u"maxLength": _validators.maxLength,
        u"maximum": _validators.maximum,
        u"minItems": _validators.minItems,