Arguments.
This commit is contained in:
@@ -10,6 +10,19 @@ Creating or Extending Validators
|
|||||||
|
|
||||||
Create a new validator.
|
Create a new validator.
|
||||||
|
|
||||||
|
:argument dict meta_schema: the meta schema for the new validator
|
||||||
|
:argument dict validators: a mapping from validator names to functions that
|
||||||
|
validate the given name. Each function should take 4 arguments: a
|
||||||
|
validator instance, the value of the current validator property in the
|
||||||
|
instance being validated, the instance, and the schema.
|
||||||
|
:argument str version: an identifier for the version that this validator
|
||||||
|
will validate. If provided, the returned validator class will have its
|
||||||
|
``__name__`` set to include the version, and also will have
|
||||||
|
:func:`validates` automatically called for the given version.
|
||||||
|
:argument dict default_types: a default mapping to use for instances of the
|
||||||
|
validator when mapping between JSON types to Python types. The default
|
||||||
|
for this argument is probably fine. Instances of the returned validator
|
||||||
|
can still have their types customized on a per-instance basis.
|
||||||
:returns: an :class:`jsonschema.IValidator`
|
:returns: an :class:`jsonschema.IValidator`
|
||||||
|
|
||||||
.. autofunction:: validates
|
.. autofunction:: validates
|
||||||
|
|||||||
@@ -96,10 +96,8 @@ adhere to.
|
|||||||
.. attribute:: VALIDATORS
|
.. attribute:: VALIDATORS
|
||||||
|
|
||||||
A mapping of validators (:class:`str`\s) to functions that validate the
|
A mapping of validators (:class:`str`\s) to functions that validate the
|
||||||
validator property with that name. Each function should take 4
|
validator property with that name. For more information see
|
||||||
arguments: the validator instance, the value of the current validator
|
:ref:`creating-validators`.
|
||||||
property in the instance, the instance, and the schema. For more
|
|
||||||
information see :ref:`creating-validators`.
|
|
||||||
|
|
||||||
.. attribute:: schema
|
.. attribute:: schema
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user