Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for PydanticV1NotSupportedError (0.08 sec)

  1. tests/test_pydantic_v1_error.py

    from fastapi.exceptions import PydanticV1NotSupportedError
    
    with warnings.catch_warnings():
        warnings.simplefilter("ignore", UserWarning)
        from pydantic.v1 import BaseModel
    
    
    def test_raises_pydantic_v1_model_in_endpoint_param() -> None:
        class ParamModelV1(BaseModel):
            name: str
    
        app = FastAPI()
    
        with pytest.raises(PydanticV1NotSupportedError):
    
            @app.post("/param")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 2.3K bytes
    - Viewed (0)
  2. fastapi/utils.py

        Undefined,
        UndefinedType,
        Validator,
        annotation_is_pydantic_v1,
    )
    from fastapi.datastructures import DefaultPlaceholder, DefaultType
    from fastapi.exceptions import FastAPIDeprecationWarning, PydanticV1NotSupportedError
    from pydantic import BaseModel
    from pydantic.fields import FieldInfo
    from typing_extensions import Literal
    
    from ._compat import v2
    
    if TYPE_CHECKING:  # pragma: nocover
        from .routing import APIRoute
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  3. tests/test_jsonable_encoder.py

    from typing import Optional, TypedDict
    
    import pytest
    from fastapi._compat import Undefined
    from fastapi.encoders import jsonable_encoder
    from fastapi.exceptions import PydanticV1NotSupportedError
    from pydantic import BaseModel, Field, ValidationError
    
    
    class Person:
        def __init__(self, name: str):
            self.name = name
    
    
    class Pet:
        def __init__(self, owner: Person, name: str):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 9.2K bytes
    - Viewed (0)
  4. fastapi/exceptions.py

            body: Any = None,
            endpoint_ctx: Optional[EndpointContext] = None,
        ) -> None:
            super().__init__(errors, endpoint_ctx=endpoint_ctx)
            self.body = body
    
    
    class PydanticV1NotSupportedError(FastAPIError):
        """
        A pydantic.v1 model is used, which is no longer supported.
        """
    
    
    class FastAPIDeprecationWarning(UserWarning):
        """
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 6.8K bytes
    - Viewed (0)
Back to top