:py:mod:`buildtest.schemas.defaults`
====================================
.. py:module:: buildtest.schemas.defaults
Module Contents
---------------
Functions
~~~~~~~~~
.. autoapisummary::
buildtest.schemas.defaults.custom_validator
Attributes
~~~~~~~~~~
.. autoapisummary::
buildtest.schemas.defaults.here
buildtest.schemas.defaults.schema_table
buildtest.schemas.defaults.schema_store
buildtest.schemas.defaults.registry
.. py:data:: here
.. py:data:: schema_table
.. py:data:: schema_store
.. py:data:: registry
.. py:function:: custom_validator(recipe, schema)
Validate a JSON document against a given schema using a custom validator.
This function utilizes `Registry` from the `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 `_
:param recipe: Loaded test recipe as YAML document
:type recipe: dict
:param schema: Schema document loaded in JSON format
:type schema: dict
:raises jsonschema.exceptions.ValidationError: if recipe fails to validate with schema