Skip to content

Commit

Permalink
Update deprecated call of general_plain_validator_function (#897)
Browse files Browse the repository at this point in the history
  • Loading branch information
dslemusp committed May 1, 2024
1 parent 0e53aa7 commit 10cb0c0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions beanie/odm/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema: # type: ignore
return core_schema.json_or_python_schema(
python_schema=core_schema.general_plain_validator_function(
python_schema=core_schema.with_info_plain_validator_function(
cls.validate
),
json_schema=str_schema(),
Expand Down Expand Up @@ -397,7 +397,7 @@ def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema: # type: ignore
return core_schema.json_or_python_schema(
python_schema=core_schema.general_plain_validator_function(
python_schema=core_schema.with_info_plain_validator_function(
cls.build_validation(handler, source_type)
),
json_schema=core_schema.typed_dict_schema(
Expand All @@ -414,7 +414,7 @@ def __get_pydantic_core_schema__(
lambda instance: cls.serialize(instance) # type: ignore
),
)
return core_schema.general_plain_validator_function(
return core_schema.with_info_plain_validator_function(
cls.build_validation(handler, source_type)
)

Expand Down Expand Up @@ -474,7 +474,7 @@ def validate(v: Union[DBRef, T], field):
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema: # type: ignore
return core_schema.general_plain_validator_function(
return core_schema.with_info_plain_validator_function(
cls.build_validation(handler, source_type)
)

Expand Down Expand Up @@ -581,7 +581,7 @@ def validate(v, _):
else:
return IndexModelField(IndexModel(v))

return core_schema.general_plain_validator_function(validate)
return core_schema.with_info_plain_validator_function(validate)

else:

Expand Down

0 comments on commit 10cb0c0

Please sign in to comment.