Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 53 for Class1 (0.04 sec)

  1. fastapi/exceptions.py

    WebSocketErrorModel: type[BaseModel] = create_model("WebSocket")
    
    
    class FastAPIError(RuntimeError):
        """
        A generic, FastAPI-specific error.
        """
    
    
    class DependencyScopeError(FastAPIError):
        """
        A dependency declared that it depends on another dependency with an invalid
        (narrower) scope.
        """
    
    
    class ValidationException(Exception):
        def __init__(
            self,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 6.8K bytes
    - Viewed (0)
  2. tests/test_jsonable_encoder.py

    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):
            self.owner = owner
            self.name = name
    
    
    @dataclass
    class Item:
        name: str
        count: int
    
    
    class DictablePerson(Person):
        def __iter__(self):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 9.2K bytes
    - Viewed (0)
  3. tests/test_pydantic_v1_error.py

    def test_raises_pydantic_v1_model_in_endpoint_param() -> None:
        class ParamModelV1(BaseModel):
            name: str
    
        app = FastAPI()
    
        with pytest.raises(PydanticV1NotSupportedError):
    
            @app.post("/param")
            def endpoint(data: ParamModelV1):  # pragma: no cover
                return data
    
    
    def test_raises_pydantic_v1_model_in_return_type() -> None:
        class ReturnModelV1(BaseModel):
            name: str
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 2.3K bytes
    - Viewed (0)
  4. tests/test_compat.py

    
    def test_propagates_pydantic2_model_config():
        app = FastAPI()
    
        class Missing:
            def __bool__(self):
                return False
    
        class EmbeddedModel(BaseModel):
            model_config = ConfigDict(arbitrary_types_allowed=True)
            value: Union[str, Missing] = Missing()
    
        class Model(BaseModel):
            model_config = ConfigDict(
                arbitrary_types_allowed=True,
            )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 4.2K bytes
    - Viewed (0)
  5. tests/test_filter_pydantic_sub_model_pv2.py

    
    @pytest.fixture(name="client")
    def get_client():
        from pydantic import BaseModel, ValidationInfo, field_validator
    
        app = FastAPI()
    
        class ModelB(BaseModel):
            username: str
    
        class ModelC(ModelB):
            password: str
    
        class ModelA(BaseModel):
            name: str
            description: Optional[str] = None
            foo: ModelB
            tags: dict[str, str] = {}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 6.6K bytes
    - Viewed (0)
  6. fastapi/params.py

    from typing_extensions import Literal, deprecated
    
    from ._compat import (
        Undefined,
    )
    
    _Unset: Any = Undefined
    
    
    class ParamTypes(Enum):
        query = "query"
        header = "header"
        path = "path"
        cookie = "cookie"
    
    
    class Param(FieldInfo):  # type: ignore[misc]
        in_: ParamTypes
    
        def __init__(
            self,
            default: Any = Undefined,
            *,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 26.3K bytes
    - Viewed (0)
  7. tests/test_request_params/test_query/test_optional_str.py

    # =====================================================================================
    # Without aliases
    
    
    @app.get("/optional-str")
    async def read_optional_str(p: Optional[str] = None):
        return {"p": p}
    
    
    class QueryModelOptionalStr(BaseModel):
        p: Optional[str] = None
    
    
    @app.get("/model-optional-str")
    async def read_model_optional_str(p: Annotated[QueryModelOptionalStr, Query()]):
        return {"p": p.p}
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.1K bytes
    - Viewed (0)
  8. fastapi/openapi/models.py

    
    class OAuthFlow(BaseModelWithConfig):
        refreshUrl: Optional[str] = None
        scopes: dict[str, str] = {}
    
    
    class OAuthFlowImplicit(OAuthFlow):
        authorizationUrl: str
    
    
    class OAuthFlowPassword(OAuthFlow):
        tokenUrl: str
    
    
    class OAuthFlowClientCredentials(OAuthFlow):
        tokenUrl: str
    
    
    class OAuthFlowAuthorizationCode(OAuthFlow):
        authorizationUrl: str
        tokenUrl: str
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 15.1K bytes
    - Viewed (0)
  9. tests/test_request_params/test_cookie/test_required_str.py

    # Without aliases
    
    
    @app.get("/required-str")
    async def read_required_str(p: Annotated[str, Cookie()]):
        return {"p": p}
    
    
    class CookieModelRequiredStr(BaseModel):
        p: str
    
    
    @app.get("/model-required-str")
    async def read_model_required_str(p: Annotated[CookieModelRequiredStr, Cookie()]):
        return {"p": p.p}
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10.2K bytes
    - Viewed (0)
  10. tests/test_get_model_definitions_formfeed_escape.py

    def client_fixture() -> TestClient:
        from pydantic import BaseModel
    
        class Address(BaseModel):
            """
            This is a public description of an Address
            \f
            You can't see this part of the docstring, it's private!
            """
    
            line_1: str
            city: str
            state_province: str
    
        class Facility(BaseModel):
            id: str
            address: Address
    
        app = FastAPI()
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 5.8K bytes
    - Viewed (0)
Back to top