Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 351 for typing (0.03 sec)

  1. fastapi/_compat/shared.py

    import sys
    import types
    import typing
    import warnings
    from collections import deque
    from collections.abc import Mapping, Sequence
    from dataclasses import is_dataclass
    from typing import (
        Annotated,
        Any,
        Union,
    )
    
    from fastapi.types import UnionType
    from pydantic import BaseModel
    from pydantic.version import VERSION as PYDANTIC_VERSION
    from starlette.datastructures import UploadFile
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 6.7K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/extra-models.md

    It will be defined in OpenAPI with `anyOf`.
    
    To do that, use the standard Python type hint <a href="https://docs.python.org/3/library/typing.html#typing.Union" class="external-link" target="_blank">`typing.Union`</a>:
    
    /// note
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 6.9K bytes
    - Viewed (0)
  3. docs/en/docs/python-types.md

    To declare those types and the internal types, you can use the standard Python module `typing`. It exists specifically to support these type hints.
    
    #### Newer versions of Python { #newer-versions-of-python }
    
    The syntax using `typing` is **compatible** with all versions, from Python 3.6 to the latest ones, including Python 3.9, Python 3.10, etc.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 15.6K bytes
    - Viewed (0)
  4. docs/de/docs/tutorial/extra-models.md

    Dies wird in OpenAPI mit `anyOf` definiert.
    
    Um das zu tun, verwenden Sie den Standard-Python-Typhinweis <a href="https://docs.python.org/3/library/typing.html#typing.Union" class="external-link" target="_blank">`typing.Union`</a>:
    
    /// note | Hinweis
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 24 10:28:19 UTC 2025
    - 8K bytes
    - Viewed (0)
  5. fastapi/security/http.py

    import binascii
    from base64 import b64decode
    from typing import Annotated, Optional
    
    from annotated_doc import Doc
    from fastapi.exceptions import HTTPException
    from fastapi.openapi.models import HTTPBase as HTTPBaseModel
    from fastapi.openapi.models import HTTPBearer as HTTPBearerModel
    from fastapi.security.base import SecurityBase
    from fastapi.security.utils import get_authorization_scheme_param
    from pydantic import BaseModel
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 13.2K bytes
    - Viewed (0)
  6. docs/ru/docs/python-types.md

    Чтобы объявлять эти типы и их внутренние типы, вы можете использовать стандартный модуль Python `typing`. Он существует специально для поддержки подсказок типов.
    
    #### Новые версии Python { #newer-versions-of-python }
    
    Синтаксис с использованием `typing` **совместим** со всеми версиями, от Python 3.6 до самых новых, включая Python 3.9, Python 3.10 и т.д.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 24.4K bytes
    - Viewed (0)
  7. docs_src/body/tutorial001_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
    
    
    app = FastAPI()
    
    
    @app.post("/items/")
    async def create_item(item: Item):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 309 bytes
    - Viewed (0)
  8. docs_src/query_params_str_validations/tutorial002_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[Union[str, None], Query(max_length=50)] = None):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 322 bytes
    - Viewed (0)
  9. docs_src/response_model/tutorial003_01_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    app = FastAPI()
    
    
    class BaseUser(BaseModel):
        username: str
        email: EmailStr
        full_name: Union[str, None] = None
    
    
    class UserIn(BaseUser):
        password: str
    
    
    @app.post("/user/")
    async def create_user(user: UserIn) -> BaseUser:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 349 bytes
    - Viewed (0)
  10. docs_src/query_params_str_validations/tutorial004_py39.py

    from typing import Union
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Union[str, None] = Query(
            default=None, min_length=3, max_length=50, pattern="^fixedquery$"
        ),
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 367 bytes
    - Viewed (0)
Back to top