Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 73 for utils (0.17 sec)

  1. fastapi/utils.py

        return new_field
    
    
    def generate_operation_id_for_path(
        *, name: str, path: str, method: str
    ) -> str:  # pragma: nocover
        warnings.warn(
            "fastapi.utils.generate_operation_id_for_path() was deprecated, "
            "it is not used internally, and will be removed soon",
            DeprecationWarning,
            stacklevel=2,
        )
        operation_id = f"{name}{path}"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  2. fastapi/openapi/utils.py

    from fastapi.dependencies.utils import get_flat_dependant, get_flat_params
    from fastapi.encoders import jsonable_encoder
    from fastapi.openapi.constants import METHODS_WITH_BODY, REF_PREFIX, REF_TEMPLATE
    from fastapi.openapi.models import OpenAPI
    from fastapi.params import Body, Param
    from fastapi.responses import Response
    from fastapi.types import ModelNameMap
    from fastapi.utils import (
        deep_dict_update,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  3. fastapi/dependencies/utils.py

    from fastapi.logger import logger
    from fastapi.security.base import SecurityBase
    from fastapi.security.oauth2 import OAuth2, SecurityScopes
    from fastapi.security.open_id_connect_url import OpenIdConnect
    from fastapi.utils import create_response_field, get_path_param_names
    from pydantic.fields import FieldInfo
    from starlette.background import BackgroundTasks as StarletteBackgroundTasks
    from starlette.concurrency import run_in_threadpool
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  4. docs/de/docs/how-to/extending-openapi.md

    Standardmäßig überprüft die Methode `.openapi()` die Eigenschaft `.openapi_schema`, um zu sehen, ob diese Inhalt hat, und gibt diesen zurück.
    
    Ist das nicht der Fall, wird der Inhalt mithilfe der Hilfsfunktion unter `fastapi.openapi.utils.get_openapi` generiert.
    
    Und diese Funktion `get_openapi()` erhält als Parameter:
    
    * `title`: Der OpenAPI-Titel, der in der Dokumentation angezeigt wird.
    * `version`: Die Version Ihrer API, z. B. `2.5.0`.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 14 16:44:05 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.extra_data_types.tutorial001_an_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_extra_types(client: TestClient):
        item_id = "ff97dd87-a4a5-4a12-b412-cde99f33e00e"
        data = {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 7K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_testing/test_main_b_an_py310.py

    from ...utils import needs_py310
    
    
    @needs_py310
    def test_app():
        from docs_src.app_testing.app_b_an_py310 import test_main
    
        test_main.test_create_existing_item()
        test_main.test_create_item()
        test_main.test_create_item_bad_token()
        test_main.test_read_nonexistent_item()
        test_main.test_read_item()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 360 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.body_multiple_params.tutorial003_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_post_body_valid(client: TestClient):
        response = client.put(
            "/items/5",
            json={
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.path_operation_advanced_configuration.tutorial007 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv2
    def test_post(client: TestClient):
        yaml_data = """
            name: Deadpoolio
            tags:
            - x-force
            - x-men
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  9. tests/test_regex_deprecated_body.py

    import pytest
    from dirty_equals import IsDict
    from fastapi import FastAPI, Form
    from fastapi.testclient import TestClient
    from typing_extensions import Annotated
    
    from .utils import needs_py310
    
    
    def get_client():
        app = FastAPI()
        with pytest.warns(DeprecationWarning):
    
            @app.post("/items/")
            async def read_items(
                q: Annotated[str | None, Form(regex="^fixedquery$")] = None,
            ):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  10. docs/zh/docs/advanced/extending-openapi.md

    作为应用对象创建的组成部分,要注册 `/openapi.json` (或其它为 `openapi_url` 设置的任意内容)*路径操作*。
    
    它只返回包含应用的 `.openapi()` 方法操作结果的 JSON 响应。
    
    但默认情况下,`.openapi()` 只是检查 `.openapi_schema` 属性是否包含内容,并返回其中的内容。
    
    如果 `.openapi_schema` 属性没有内容,该方法就使用 `fastapi.openapi.utils.get_openapi` 工具函数生成内容。
    
    `get_openapi()` 函数接收如下参数:
    
    * `title`:文档中显示的 OpenAPI 标题
    * `version`:API 的版本号,例如 `2.5.0`
    * `openapi_version`: OpenAPI 规范的版本号,默认为最新版: `3.0.2`
    * `description`:API 的描述说明
    Plain Text
    - Registered: Sun Mar 31 07:19:09 GMT 2024
    - Last Modified: Sat Mar 30 22:46:12 GMT 2024
    - 7.7K bytes
    - Viewed (0)
Back to top