ocrd_validators.resource_list_validator module

Validating resource_list.yml.

See specs.

class ocrd_validators.resource_list_validator.OcrdResourceListValidator(schema, validator_class=<class 'jsonschema.validators.Draft6Validator'>)[source]

Bases: JsonValidator

JsonValidator validating against the resource_list.yml schema.

Construct a JsonValidator.

  • schema (dict) –

  • validator_class (Draft6Validator|DefaultValidatingDraft6Validator) –

static validate(obj, schema={'additionalProperties': False, 'patternProperties': {'^ocrd-.*': {'description': 'Resources for this processor', 'items': {'additionalProperties': False, 'properties': {'description': {'description': 'A description of the resource', 'type': 'string'}, 'name': {'description': 'Name to store the resource as', 'type': 'string'}, 'parameter_usage': {'default': 'as-is', 'description': 'Defines how the parameter is to be used', 'enum': ['as-is', 'without-extension'], 'type': 'string'}, 'path_in_archive': {'default': '.', 'description': 'if type is archive, the resource is at this location in the archive', 'type': 'string'}, 'size': {'description': 'Size of the resource in bytes', 'type': 'number'}, 'type': {'default': 'file', 'description': 'Type of the URL', 'enum': ['file', 'directory', 'archive'], 'type': 'string'}, 'url': {'description': 'URLs of all components of this resource', 'type': 'string'}, 'version_range': {'default': '>= 0.0.1', 'description': 'Range of supported versions, syntax like in PEP 440', 'type': 'string'}}, 'required': ['url', 'description', 'name', 'size'], 'type': 'object'}, 'type': 'array'}}, 'type': 'object'})[source]

Validate against resource_list.schema.yml schema.