File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11from typing import Annotated , Any
22
3- from pydantic import BaseModel , ConfigDict , PlainValidator , WithJsonSchema
3+ from pydantic import BaseModel , BeforeValidator , ConfigDict , WithJsonSchema
44from pydantic .json_schema import JsonSchemaValue
55from pydantic_core .core_schema import ValidationInfo
66from tree_sitter import Point , Range
@@ -45,7 +45,7 @@ def range_json_schema() -> JsonSchemaValue:
4545
4646RangeAdapter = Annotated [
4747 Range ,
48- PlainValidator (validate_range ),
48+ BeforeValidator (validate_range ),
4949 WithJsonSchema (range_json_schema ()),
5050]
5151
@@ -56,6 +56,7 @@ class Span(BaseModel):
5656
5757 model_config = ConfigDict (
5858 frozen = True ,
59+ arbitrary_types_allowed = True ,
5960 json_encoders = {
6061 Range : lambda r : {
6162 "start_byte" : r .start_byte ,
You can’t perform that action at this time.
0 commit comments