diff --git a/ipywidgets_jsonschema/form.py b/ipywidgets_jsonschema/form.py index 86f2c7e..af9b094 100644 --- a/ipywidgets_jsonschema/form.py +++ b/ipywidgets_jsonschema/form.py @@ -4,6 +4,7 @@ import collections import ipywidgets import jsonschema +from jsonschema.validators import Draft7Validator import json import os import re @@ -99,13 +100,7 @@ def __init__( the built-in sorted, but is no-op if sorted raises a TypeError. """ # Make sure that the given schema is valid - filename = os.path.join( - os.path.split(jsonschema.__file__)[0], "schemas", "draft7.json" - ) - with open(filename, "r") as f: - meta_schema = json.load(f) - meta_schema["additionalProperties"] = False - jsonschema.validate(instance=schema, schema=meta_schema) + Draft7Validator.check_schema(schema) # Store the given data members self.schema = schema diff --git a/pyproject.toml b/pyproject.toml index 153b0b4..8389417 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ classifiers = [ dependencies = [ "IPython", "ipywidgets", - "jsonschema<4", + "jsonschema<5", "packaging", "traitlets", ]