Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelauv committed Sep 25, 2023
1 parent 2c10430 commit 521a354
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions fastapi/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
from pydantic_core import PydanticUndefined, PydanticUndefinedType
from pydantic_core import Url as Url
from pydantic_core.core_schema import (
general_plain_validator_function as general_plain_validator_function,
with_info_plain_validator_function as with_info_plain_validator_function,
)

Required = PydanticUndefined
Expand Down Expand Up @@ -345,7 +345,7 @@ class GenerateJsonSchema: # type: ignore[no-redef]
class PydanticSchemaGenerationError(Exception): # type: ignore[no-redef]
pass

def general_plain_validator_function( # type: ignore[misc]
def with_info_plain_validator_function( # type: ignore[misc]
function: Callable[..., Any],
*,
ref: Union[str, None] = None,
Expand Down
4 changes: 2 additions & 2 deletions fastapi/datastructures.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
CoreSchema,
GetJsonSchemaHandler,
JsonSchemaValue,
general_plain_validator_function,
with_info_plain_validator_function,
)
from starlette.datastructures import URL as URL # noqa: F401
from starlette.datastructures import Address as Address # noqa: F401
Expand Down Expand Up @@ -49,7 +49,7 @@ def __get_pydantic_json_schema__(
def __get_pydantic_core_schema__(
cls, source: Type[Any], handler: Callable[[Any], CoreSchema]
) -> CoreSchema:
return general_plain_validator_function(cls._validate)
return with_info_plain_validator_function(cls._validate)


class DefaultPlaceholder:
Expand Down
4 changes: 2 additions & 2 deletions fastapi/openapi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
GetJsonSchemaHandler,
JsonSchemaValue,
_model_rebuild,
general_plain_validator_function,
with_info_plain_validator_function,
)
from fastapi.logger import logger
from pydantic import AnyUrl, BaseModel, Field
Expand Down Expand Up @@ -52,7 +52,7 @@ def __get_pydantic_json_schema__(
def __get_pydantic_core_schema__(
cls, source: Type[Any], handler: Callable[[Any], CoreSchema]
) -> CoreSchema:
return general_plain_validator_function(cls._validate)
return with_info_plain_validator_function(cls._validate)


class Contact(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_model_field_default_required():


@needs_pydanticv1
def test_upload_file_dummy_general_plain_validator_function():
def test_upload_file_dummy_with_info_plain_validator_function():
# For coverage
assert UploadFile.__get_pydantic_core_schema__(str, lambda x: None) == {}

Expand Down

0 comments on commit 521a354

Please sign in to comment.