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.create.<locals>.Validator'>)[source]

Bases: ocrd_validators.json_validator.JsonValidator

JsonValidator validating against the resource_list.yml schema.

static validate(obj, schema={'additionalProperties': False, 'patternProperties': {'^ocrd-.*': {'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', 'github-dir', 'tarball'], '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.