.. _creating-validators:

================================
Creating or Extending Validators
================================

.. currentmodule:: jsonschema

.. autoclass:: ValidatorMixin

.. autofunction:: validates


Creating Validation Errors
--------------------------

Any validating function that recurses into an instance (e.g. ``properties`` or
``items``) must call ``appendleft`` on the :exc:`ValidationError.path`
attribute of the error in order to properly maintain where in the instance the
error occurred.

.. _creating-validators:

================================
Creating or Extending Validators
================================

.. currentmodule:: jsonschema

.. autoclass:: ValidatorMixin

.. autofunction:: validates


Creating Validation Errors
--------------------------

Any validating function that validates against a subschema should call
:meth:`ValidatorMixin.descend`, rather than :meth:`ValidatorMixin.iter_errors`.
If it recurses into the instance, or schema, it must set the ``path`` or
``schema_path`` in order to properly maintain where in the instance and schema
the error occurred.

Update docs for descend method
Update docs for descend method
