summaryrefslogtreecommitdiff
path: root/docs/creating.rst
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2017-12-24 10:11:11 -0500
committerJulian Berman <Julian@GrayVines.com>2017-12-24 10:11:11 -0500
commit02b9cc2c450ba014cac990ae413f7bc7c1ad6eb0 (patch)
treeb3ce357a0d7271275927835574222a34eda1b155 /docs/creating.rst
parente46f846fd40f7c56e2c6cdf2554b75a8b6809b1a (diff)
parente2264e56c7375c9ec5aeb1175773da4f0079f3c7 (diff)
downloadjsonschema-02b9cc2c450ba014cac990ae413f7bc7c1ad6eb0.tar.gz
Merge remote-tracking branch 'bsmithers/types_draft4'
* bsmithers/types_draft4: Simplify redefine_many. Minor changes addressing PR review issues Add checker instance to type checking functions Use attr.ib's convert arg to generate the pmap Revert "Allow _type_checkers to be def'd as a dict at init" Fix the default_types deprecation Allow _type_checkers to be def'd as a dict at init Updated docs with new TypeChecker interface The new type interface: a TypeChecker class
Diffstat (limited to 'docs/creating.rst')
-rw-r--r--docs/creating.rst17
1 files changed, 13 insertions, 4 deletions
diff --git a/docs/creating.rst b/docs/creating.rst
index 9964419..f5af2e8 100644
--- a/docs/creating.rst
+++ b/docs/creating.rst
@@ -29,10 +29,16 @@ Creating or Extending Validator Classes
also will have :func:`jsonschema.validators.validates` automatically
called for the given version.
- :argument dict default_types: a default mapping to use for instances
- of the validator class when mapping between JSON types to Python
- types. The default for this argument is probably fine. Instances
- can still have their types customized on a per-instance basis.
+ :argument dict default_types:
+ .. deprecated:: 2.7.0 Please use the type_checker argument instead.
+
+ If set, it provides mappings of JSON types to Python types that will
+ be converted to functions and redefined in this object's
+ :class:`jsonschema.TypeChecker`.
+
+ :argument jsonschema.TypeChecker type_checker: a type checker. If
+ unprovided, a :class:`jsonschema.TypeChecker` will created with no
+ supported types.
:returns: a new :class:`jsonschema.IValidator` class
@@ -59,6 +65,9 @@ Creating or Extending Validator Classes
:argument str version: a version for the new validator class
+ :argument jsonschema.TypeChecker type_checker: a type checker. If
+ unprovided, the existing :class:`jsonschema.TypeChecker` will be used.
+
:returns: a new :class:`jsonschema.IValidator` class
.. note:: Meta Schemas