Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 11 - 20 of 542 for Annotated (0.17 seconds)

  1. tests/test_security_scopes_sub_dependency.py

            security_scopes: SecurityScopes,
            db_session: Annotated[str, Depends(get_db_session)],
        ):
            call_counts["get_current_user"] += 1
            return {
                "user": f"user_{call_counts['get_current_user']}",
                "scopes": security_scopes.scopes,
                "db_session": db_session,
            }
    
        def get_user_me(
            current_user: Annotated[dict, Security(get_current_user, scopes=["me"])],
        ):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 2.9K bytes
    - Click Count (0)
  2. docs/ko/docs/tutorial/path-params-numeric-validations.md

    ## `Path` 임포트 { #import-path }
    
    먼저 `fastapi`에서 `Path`를 임포트하고, `Annotated`도 임포트합니다:
    
    {* ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py hl[1,3] *}
    
    /// info | 정보
    
    FastAPI는 0.95.0 버전에서 `Annotated` 지원을 추가했고(그리고 이를 권장하기 시작했습니다).
    
    더 오래된 버전이 있다면 `Annotated`를 사용하려고 할 때 오류가 발생합니다.
    
    `Annotated`를 사용하기 전에 최소 0.95.1까지 [FastAPI 버전 업그레이드](../deployment/versions.md#upgrading-the-fastapi-versions)를 꼭 하세요.
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 7.2K bytes
    - Click Count (0)
  3. tests/test_request_params/test_form/test_optional_list.py

    async def read_optional_list_alias(
        p: Annotated[list[str] | None, Form(alias="p_alias")] = None,
    ):
        return {"p": p}
    
    
    class FormModelOptionalListAlias(BaseModel):
        p: list[str] | None = Field(None, alias="p_alias")
    
    
    @app.post("/model-optional-list-alias", operation_id="model_optional_list_alias")
    async def read_model_optional_list_alias(
        p: Annotated[FormModelOptionalListAlias, Form()],
    ):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 9.9K bytes
    - Click Count (0)
  4. tests/test_dependency_yield_scope_websockets.py

        yield s
        s.open = False
        global_state = global_context.get()
        global_state["session_closed"] = True
    
    
    SessionFuncDep = Annotated[Session, Depends(dep_session, scope="function")]
    SessionRequestDep = Annotated[Session, Depends(dep_session, scope="request")]
    SessionDefaultDep = Annotated[Session, Depends(dep_session)]
    
    
    class NamedSession:
        def __init__(self, name: str = "default") -> None:
            self.name = name
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 6K bytes
    - Click Count (0)
  5. build-logic/binary-compatibility/src/test/groovy/gradlebuild/binarycompatibility/PublicAPIRulesTest.groovy

            where:
            ruleElem << [new BinaryBreakingChangesRule([:]), new SinceAnnotationRule([:]), new IncubatingMissingRule([:])]
            error << ['Is not binary compatible.', 'Is not annotated with @since', 'Is not annotated with @Incubating']
        }
    
        def "the @since annotation on inner classes is recognised"() {
            given:
            def rule = withContext(new SinceAnnotationRule([:]))
    Created: Wed Apr 01 11:36:16 GMT 2026
    - Last Modified: Fri Jun 06 17:52:09 GMT 2025
    - 16K bytes
    - Click Count (0)
  6. tests/benchmarks/test_general_performance.py

    def sync_validated(item: ItemIn, dep: Annotated[int, Depends(dep_b)]):
        return ItemOut(name=item.name, value=item.value, dep=dep)
    
    
    @app.get("/sync/dict-no-response-model")
    def sync_dict_no_response_model():
        return {"name": "foo", "value": 123}
    
    
    @app.get("/sync/dict-with-response-model", response_model=ItemOut)
    def sync_dict_with_response_model(
        dep: Annotated[int, Depends(dep_b)],
    ):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Dec 26 20:40:26 GMT 2025
    - 11.1K bytes
    - Click Count (0)
  7. docs/ja/docs/tutorial/query-params-str-validations.md

    ### `Query` と `Annotated` のインポート { #import-query-and-annotated }
    
    そのために、まずは以下をインポートします:
    
    * `fastapi` から `Query`
    * `typing` から `Annotated`
    
    {* ../../docs_src/query_params_str_validations/tutorial002_an_py310.py hl[1,3] *}
    
    /// info | 情報
    
    FastAPI はバージョン 0.95.0 で `Annotated` のサポートを追加し(推奨し始め)ました。
    
    古いバージョンの場合、`Annotated` を使おうとするとエラーになります。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 20.3K bytes
    - Click Count (0)
  8. tests/test_dependency_yield_scope.py

        yield
        raise HTTPException(status_code=503, detail="Exception after yield")
    
    
    SessionFuncDep = Annotated[Session, Depends(dep_session, scope="function")]
    SessionRequestDep = Annotated[Session, Depends(dep_session, scope="request")]
    SessionDefaultDep = Annotated[Session, Depends(dep_session)]
    
    
    class NamedSession:
        def __init__(self, name: str = "default") -> None:
            self.name = name
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 6.7K bytes
    - Click Count (0)
  9. tests/test_request_params/test_header/test_optional_str.py

    from typing import Annotated
    
    import pytest
    from fastapi import FastAPI, Header
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    # =====================================================================================
    # Without aliases
    
    
    @app.get("/optional-str")
    async def read_optional_str(p: Annotated[str | None, Header()] = None):
        return {"p": p}
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 8.5K bytes
    - Click Count (0)
  10. docs/zh/docs/tutorial/path-params-numeric-validations.md

    ## 导入 `Path` { #import-path }
    
    首先,从 `fastapi` 导入 `Path`,并导入 `Annotated`:
    
    {* ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py hl[1,3] *}
    
    /// info | 信息
    
    FastAPI 在 0.95.0 版本添加了对 `Annotated` 的支持(并开始推荐使用它)。
    
    如果你使用的是更旧的版本,尝试使用 `Annotated` 会报错。
    
    请确保在使用 `Annotated` 之前,将 FastAPI 版本[升级](../deployment/versions.md#upgrading-the-fastapi-versions)到至少 0.95.1。
    
    ///
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 6K bytes
    - Click Count (0)
Back to Top