buildtest.schemas.defaults
Module Contents
Functions
|
Validate a JSON document against a given schema using a custom validator. |
Attributes
- buildtest.schemas.defaults.here
- buildtest.schemas.defaults.schema_table
- buildtest.schemas.defaults.schema_store
- buildtest.schemas.defaults.registry
- buildtest.schemas.defaults.custom_validator(recipe, schema)[source]
Validate a JSON document against a given schema using a custom validator.
This function utilizes Registry from the referencing <https://python-jsonschema.readthedocs.io/en/latest/referencing/> library to handle schema references locally and validate buildspecs with schema files on the local filesystem, ensuring that schema changes are synchronized with the code base updates.
This method uses Draft7Validator for validating schemas. If there is an error during validation jsonschema will raise an exception of type jsonschema.exceptions.ValidationError