Skip to content

Commit f3055af

Browse files
committed
Add doc section covering --validator-class
1 parent 4a0fdca commit f3055af

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/usage.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,3 +251,26 @@ not set.
251251

252252
``--base-uri`` overrides this behavior, setting a custom base URI for ``$ref``
253253
resolution.
254+
255+
``--validator-class``
256+
~~~~~~~~~~~~~~~~~~~~~
257+
258+
``check-jsonschema`` allows users to pass a custom validator class which
259+
implements the ``jsonschema.protocols.Validator`` protocol.
260+
261+
The format used for this argument is ``<module>:<class>``. For example, to
262+
explicitly use the ``jsonschema`` validator for Draft7, use
263+
``--validator-class 'jsonschema.validators:Draft7Validator'``.
264+
265+
The module containing the validator class must be importable from within the
266+
``check-jsonschema`` runtime context.
267+
268+
.. note::
269+
270+
``check-jsonschema`` will treat the validator class similarly to the
271+
``jsonschema`` library builtin validators. This includes using documented
272+
extension points like passing a format checker or the behavior enabled with
273+
``--fill-defaults``. Users of this feature are recommended to build their
274+
validators using ``jsonschema``'s documented interfaces (e.g.
275+
``jsonschema.validators.extend``) to ensure that their validators are
276+
compatible.

0 commit comments

Comments
 (0)