From 737aba6321574977f3bf7aa36843d8434fe220f8 Mon Sep 17 00:00:00 2001 From: scosman Date: Mon, 9 Sep 2024 16:04:20 -0400 Subject: [PATCH] Lock jsonschema version --- libs/core/kiln_ai/datamodel/json_schema.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/core/kiln_ai/datamodel/json_schema.py b/libs/core/kiln_ai/datamodel/json_schema.py index 50dbfa5..f30c2c6 100644 --- a/libs/core/kiln_ai/datamodel/json_schema.py +++ b/libs/core/kiln_ai/datamodel/json_schema.py @@ -3,6 +3,7 @@ import jsonschema import jsonschema.exceptions +import jsonschema.validators from pydantic import AfterValidator JsonObjectSchema = Annotated[ @@ -19,7 +20,8 @@ def _check_json_schema(v: str) -> str: def validate_schema(instance: Dict, schema_str: str) -> None: schema = schema_from_json_str(schema_str) - jsonschema.validate(instance=instance, schema=schema) + v = jsonschema.Draft202012Validator(schema) + return v.validate(instance) def schema_from_json_str(v: str) -> Dict: