Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 781 for typing (0.03 sec)

  1. docs_src/python_types/tutorial009c_py39.py

    from typing import Optional
    
    
    def say_hi(name: Optional[str]):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 89 bytes
    - Viewed (0)
  2. tests/test_schema_ref_pydantic_v2.py

    from typing import Any
    
    import pytest
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    from pydantic import BaseModel, ConfigDict, Field
    
    
    @pytest.fixture(name="client")
    def get_client():
        app = FastAPI()
    
        class ModelWithRef(BaseModel):
            ref: str = Field(validation_alias="$ref", serialization_alias="$ref")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  3. fastapi/security/utils.py

    from typing import Optional
    
    
    def get_authorization_scheme_param(
        authorization_header_value: Optional[str],
    ) -> tuple[str, str]:
        if not authorization_header_value:
            return "", ""
        scheme, _, param = authorization_header_value.partition(" ")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 286 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_dependencies/test_tutorial008.py

    import importlib
    from types import ModuleType
    from typing import Annotated, Any
    from unittest.mock import Mock, patch
    
    import pytest
    from fastapi import Depends, FastAPI
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(
        name="module",
        params=[
            "tutorial008_py39",
            # Fails with `NameError: name 'DepA' is not defined`
            pytest.param("tutorial008_an_py39", marks=pytest.mark.xfail),
        ],
    )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.4K bytes
    - Viewed (0)
  5. docs_src/cookie_params/tutorial001_py39.py

    from typing import Union
    
    from fastapi import Cookie, FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(ads_id: Union[str, None] = Cookie(default=None)):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 202 bytes
    - Viewed (0)
  6. docs_src/header_params/tutorial001_py39.py

    from typing import Union
    
    from fastapi import FastAPI, Header
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(user_agent: Union[str, None] = Header(default=None)):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 214 bytes
    - Viewed (0)
  7. docs_src/request_forms/tutorial001_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, Form
    
    app = FastAPI()
    
    
    @app.post("/login/")
    async def login(username: Annotated[str, Form()], password: Annotated[str, Form()]):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 223 bytes
    - Viewed (0)
  8. docs/ja/docs/tutorial/extra-models.md

    OpenAPIでは`anyOf`で定義されます。
    
    そのためには、標準的なPythonの型ヒント<a href="https://docs.python.org/3/library/typing.html#typing.Union" class="external-link" target="_blank">`typing.Union`</a>を使用します:
    
    {* ../../docs_src/extra_models/tutorial003.py hl[1,14,15,18,19,20,33] *}
    
    ## モデルのリスト
    
    同じように、オブジェクトのリストのレスポンスを宣言することができます。
    
    そのためには、標準のPythonの`typing.List`を使用する:
    
    {* ../../docs_src/extra_models/tutorial004.py hl[1,20] *}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  9. docs_src/header_params/tutorial002_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import FastAPI, Header
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        strange_header: Annotated[
            Union[str, None], Header(convert_underscores=False)
        ] = None,
    ):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Oct 24 20:26:06 UTC 2023
    - 288 bytes
    - Viewed (0)
  10. docs_src/header_params/tutorial003_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import FastAPI, Header
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(x_token: Annotated[Union[list[str], None], Header()] = None):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 234 bytes
    - Viewed (0)
Back to top