Skip to content

Commit 284d33f

Browse files
authored
Merge pull request #83 from tharwan/feature/jsonschema_4
adopt jsonschema version 4
2 parents 6ec87fc + e2d92f2 commit 284d33f

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

ipywidgets_jsonschema/form.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import collections
55
import ipywidgets
66
import jsonschema
7+
from jsonschema.validators import Draft7Validator
78
import json
89
import os
910
import re
@@ -99,13 +100,7 @@ def __init__(
99100
the built-in sorted, but is no-op if sorted raises a TypeError.
100101
"""
101102
# Make sure that the given schema is valid
102-
filename = os.path.join(
103-
os.path.split(jsonschema.__file__)[0], "schemas", "draft7.json"
104-
)
105-
with open(filename, "r") as f:
106-
meta_schema = json.load(f)
107-
meta_schema["additionalProperties"] = False
108-
jsonschema.validate(instance=schema, schema=meta_schema)
103+
Draft7Validator.check_schema(schema)
109104

110105
# Store the given data members
111106
self.schema = schema

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ classifiers = [
2323
dependencies = [
2424
"IPython",
2525
"ipywidgets",
26-
"jsonschema<4",
26+
"jsonschema<5",
2727
"packaging",
2828
"traitlets",
2929
]

0 commit comments

Comments
 (0)