Skip to content

Commit 194ece0

Browse files
committed
[#1914] Update documentation to use jsonschema.Draft4Validator.FORMAT_CHECKER
1 parent de007c4 commit 194ece0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: docs/validation.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -325,18 +325,18 @@ Custom type formats
325325
-------------------
326326

327327
It is possible to define custom type formats for validation without adding a custom validator, by
328-
leveraging the ``jsonschema.draft4_format_checker.checks`` decorator.
328+
leveraging the ``jsonschema.Draft4Validator.FORMAT_CHECKER.checks`` decorator.
329329

330330
We can for instance create a custom `money` format.
331331

332332
.. code-block:: python
333333
334334
import re
335-
from jsonschema import draft4_format_checker
335+
from jsonschema import Draft4Validator
336336
337337
MONEY_RE = re.compile('^\$\s*\d+(\.\d\d)?')
338338
339-
@draft4_format_checker.checks('money')
339+
@Draft4Validator.FORMAT_CHECKER.checks('money')
340340
def is_money(val):
341341
if not isinstance(val, str):
342342
return True

0 commit comments

Comments
 (0)