- Sort Score
- Num 10 results
- Language All
Results 391 - 400 of 1,555 for depend (0.08 seconds)
-
tests/test_security_oauth2_authorization_code_bearer_scopes_openapi_simple.py
) async def get_token(token: Annotated[str, Depends(oauth2_scheme)]) -> str: return token app = FastAPI(dependencies=[Depends(get_token)]) @app.get("/admin", dependencies=[Security(get_token, scopes=["read", "write"])]) async def read_admin(): return {"message": "Admin Access"} client = TestClient(app) def test_read_admin():
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 2.6K bytes - Click Count (0) -
docs/zh/docs/tutorial/dependencies/index.md
然后,依赖项函数返回包含这些值的 `dict`。 ### 导入 `Depends` {* ../../docs_src/dependencies/tutorial001.py hl[3] *} ### 声明依赖项 与在*路径操作函数*参数中使用 `Body`、`Query` 的方式相同,声明依赖项需要使用 `Depends` 和一个新的参数: {* ../../docs_src/dependencies/tutorial001.py hl[15,20] *} 虽然,在路径操作函数的参数中使用 `Depends` 的方式与 `Body`、`Query` 相同,但 `Depends` 的工作方式略有不同。 这里只能传给 Depends 一个参数。 且该参数必须是可调用对象,比如函数。 该函数接收的参数和*路径操作函数*的参数一样。Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Mon Nov 18 02:25:44 GMT 2024 - 7K bytes - Click Count (0) -
docs/de/docs/advanced/advanced-dependencies.md
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Dec 02 17:32:56 GMT 2025 - 10.4K bytes - Click Count (0) -
tests/test_security_api_key_query_optional.py
from typing import Optional from fastapi import Depends, FastAPI, Security from fastapi.security import APIKeyQuery from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() api_key = APIKeyQuery(name="key", auto_error=False) class User(BaseModel): username: str def get_current_user(oauth_header: Optional[str] = Security(api_key)): if oauth_header is None: return None
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2K bytes - Click Count (0) -
tests/test_security_api_key_cookie_optional.py
from typing import Optional from fastapi import Depends, FastAPI, Security from fastapi.security import APIKeyCookie from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() api_key = APIKeyCookie(name="key", auto_error=False) class User(BaseModel): username: str def get_current_user(oauth_header: Optional[str] = Security(api_key)): if oauth_header is None: return None
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2.1K bytes - Click Count (0) -
scripts/translate.py
skipped_paths: list[Path] = [] for p in paths_to_process: lang_path = generate_lang_path(lang=language, path=p) if lang_path.exists(): skipped_paths.append(p) continue missing_paths.append(p) print("Paths to skip:") for p in skipped_paths: print(f" - {p}") print(f"Total paths to skip: {len(skipped_paths)}") print("Paths to process:")
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 19:05:53 GMT 2025 - 34.1K bytes - Click Count (0) -
tests/test_generic_parameterless_depends.py
from typing import Annotated, TypeVar from fastapi import Depends, FastAPI from fastapi.testclient import TestClient app = FastAPI() T = TypeVar("T") Dep = Annotated[T, Depends()] class A: pass class B: pass @app.get("/a") async def a(dep: Dep[A]): return {"cls": dep.__class__.__name__} @app.get("/b") async def b(dep: Dep[B]): return {"cls": dep.__class__.__name__}
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 1.8K bytes - Click Count (0) -
tests/test_enforce_once_required_parameter.py
client_tag: Optional[str] = Depends(_get_client_tag), ): return {"client_id": client_key, "client_tag": client_tag} client = TestClient(app) expected_schema = { "components": { "schemas": { "HTTPValidationError": { "properties": { "detail": { "items": {"$ref": "#/components/schemas/ValidationError"},
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Sep 16 17:21:48 GMT 2025 - 3.3K bytes - Click Count (0) -
impl/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java
messageBuffer .append("<configuration>") .append(LS) .append(" ...") .append(LS); messageBuffer .append(" <") .append(alias) .append(">VALUE</") .append(alias)Created: Sun Dec 28 03:35:09 GMT 2025 - Last Modified: Wed Jul 23 17:27:08 GMT 2025 - 6.8K bytes - Click Count (0) -
fess-crawler-opensearch/src/test/java/org/codelibs/fess/crawler/util/CrawlerWebServer.java
Created: Sat Dec 20 11:21:39 GMT 2025 - Last Modified: Sat Mar 15 06:52:00 GMT 2025 - 5K bytes - Click Count (0)