ocrd_validators.json_validator module

Validating JSON-Schema

class ocrd_validators.json_validator.JsonValidator(schema, validator_class=<class 'jsonschema.validators.create.<locals>.Validator'>)[source]

Bases: object

JSON Schema validator.

static validate(obj, schema)[source]

Validate an object against a schema

Parameters
  • obj (dict) –

  • schema (dict) –

ocrd_validators.json_validator.extend_with_default(validator_class)[source]

Add a default-setting mechanism to a jsonschema validation class.