Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 45 for classe (0.03 sec)

  1. docs/en/docs/release-notes.md

    Before Starlette `0.24.0`, a new instance of each middleware class would be created when a new middleware was added. That normally was not a problem, unless the middleware class expected to be created only once, with only one instance, that happened in some cases. This upgrade would solve those cases (thanks [@adriangb](https://github.com/adriangb)! Starlette PR [#2017](https://github.com/encode/starlette/pull/2017)). Now the middleware class instances are created once, right before the first request...
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 19:06:15 UTC 2025
    - 586.7K bytes
    - Viewed (0)
  2. tests/test_inherited_custom_class.py

        class SomeCustomClass(BaseModel):
            model_config = {"arbitrary_types_allowed": True}
    
            a_uuid: MyUuid
    
            @field_serializer("a_uuid")
            def serialize_a_uuid(self, v):
                return str(v)
    
        @app.get("/get_custom_class")
        def return_some_user():
            # Test that the fix also works for custom pydantic classes
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 1.8K bytes
    - Viewed (0)
  3. 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)
  4. scripts/translate.py

    Example:
    
        Source (English):
    
            «««
            <a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel docs</a>
            »»»
    
        Result (German):
    
            «««
            <a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel-Dokumentation</a>
            »»»
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 19:05:53 UTC 2025
    - 34.1K bytes
    - Viewed (0)
  5. 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)
  6. fastapi/openapi/utils.py

                else:
                    # It would probably make more sense for all response classes to have an
                    # explicit default status_code, and to extract it from them, instead of
                    # doing this inspection tricks, that would probably be in the future
                    # TODO: probably make status_code a default class attribute for all
                    # responses in Starlette
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 23.2K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top