Skip to content

Commit 0fe509c

Browse files
committed
Magic
Reimplement validators with jsonschema.validators.create
1 parent 04ca6d5 commit 0fe509c

File tree

5 files changed

+522
-452
lines changed

5 files changed

+522
-452
lines changed

jsonschema/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
from jsonschema._format import (
1313
FormatChecker, FormatError, draft3_format_checker, draft4_format_checker,
1414
)
15+
from jsonschema._validators import ValidationError
1516
from jsonschema.validators import (
16-
RefResolutionError, SchemaError, ValidationError, UnknownType,
17-
ErrorTree, Draft3Validator, Draft4Validator, RefResolver, ValidatorMixin,
17+
RefResolutionError, SchemaError, UnknownType, ErrorTree,
18+
Draft3Validator, Draft4Validator, RefResolver, ValidatorMixin,
1819
validate, validates,
1920
)
2021

jsonschema/_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ def __repr__(self):
3838
return repr(self.store)
3939

4040

41+
class Unset(object):
42+
"""
43+
An as-of-yet unset attribute or unprovided default parameter.
44+
45+
"""
46+
47+
def __repr__(self):
48+
return "<unset>"
49+
50+
4151
def load_schema(name):
4252
"""
4353
Load a schema from ./schemas/``name``.json and return it.

0 commit comments

Comments
 (0)