Skip to content

Commit

Permalink
Lock jsonschema version
Browse files Browse the repository at this point in the history
  • Loading branch information
scosman committed Sep 9, 2024
1 parent cb4d756 commit 737aba6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/core/kiln_ai/datamodel/json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import jsonschema
import jsonschema.exceptions
import jsonschema.validators
from pydantic import AfterValidator

JsonObjectSchema = Annotated[
Expand All @@ -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:
Expand Down

0 comments on commit 737aba6

Please sign in to comment.