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 1
1
from typing import Annotated , Any
2
2
3
- from pydantic import BaseModel , ConfigDict , PlainValidator , WithJsonSchema
3
+ from pydantic import BaseModel , BeforeValidator , ConfigDict , WithJsonSchema
4
4
from pydantic .json_schema import JsonSchemaValue
5
5
from pydantic_core .core_schema import ValidationInfo
6
6
from tree_sitter import Point , Range
@@ -45,7 +45,7 @@ def range_json_schema() -> JsonSchemaValue:
45
45
46
46
RangeAdapter = Annotated [
47
47
Range ,
48
- PlainValidator (validate_range ),
48
+ BeforeValidator (validate_range ),
49
49
WithJsonSchema (range_json_schema ()),
50
50
]
51
51
@@ -56,6 +56,7 @@ class Span(BaseModel):
56
56
57
57
model_config = ConfigDict (
58
58
frozen = True ,
59
+ arbitrary_types_allowed = True ,
59
60
json_encoders = {
60
61
Range : lambda r : {
61
62
"start_byte" : r .start_byte ,
You can’t perform that action at this time.
0 commit comments