- Sort Score
- Result 10 results
- Languages All
Results 451 - 460 of 805 for fdef (0.01 sec)
-
tests/test_openapi_schema_type.py
[ "array", ["string", "null"], None, ], ) def test_allowed_schema_type( type_value: Optional[Union[SchemaType, list[SchemaType]]], ) -> None: """Test that Schema accepts SchemaType, List[SchemaType] and None for type field.""" schema = Schema(type=type_value) assert schema.type == type_value def test_invalid_type_value() -> None:Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 730 bytes - Viewed (0) -
docs_src/app_testing/app_a_py39/test_main.py
from fastapi.testclient import TestClient from .main import app client = TestClient(app) def test_read_main(): response = client.get("/") assert response.status_code == 200
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 238 bytes - Viewed (0) -
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) -
docs_src/dependencies/tutorial008d_an_py39.py
app = FastAPI() class InternalError(Exception): pass def get_username(): try: yield "Rick" except InternalError: print("We don't swallow the internal error here, we raise again π") raise @app.get("/items/{item_id}") def get_item(item_id: str, username: Annotated[str, Depends(get_username)]): if item_id == "portal-gun":
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Feb 24 23:06:37 UTC 2024 - 734 bytes - Viewed (0) -
tests/test_depends_hashable.py
# as other tools that use them depend on that # Ref: https://github.com/fastapi/fastapi/pull/14320 from fastapi import Depends, Security def dep(): pass def test_depends_hashable(): dep() # just for coverage d1 = Depends(dep) d2 = Depends(dep) d3 = Depends(dep, scope="function") d4 = Depends(dep, scope="function")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Nov 19 16:50:18 UTC 2025 - 596 bytes - Viewed (0) -
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) -
docs_src/request_forms/tutorial001_an_py39.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 223 bytes - Viewed (0) -
docs/ru/docs/index.md
app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} ``` <details markdown="1"> <summary>ΠΠ»ΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ <code>async def</code>...</summary> ΠΡΠ»ΠΈ Π²Π°Ρ ΠΊΠΎΠ΄ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅Ρ `async` / `await`, ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ `async def`: ```Python hl_lines="9 14"
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Thu Dec 11 21:25:03 UTC 2025 - 32K bytes - Viewed (0) -
docs/ru/docs/advanced/events.md
ΠΡ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΠΎΠΏΡΠ΅Π΄Π΅Π»ΠΈΡΡ ΠΎΠ±ΡΠ°Π±ΠΎΡΡΠΈΠΊΠΈ ΡΠΎΠ±ΡΡΠΈΠΉ (ΡΡΠ½ΠΊΡΠΈΠΈ), ΠΊΠΎΡΠΎΡΡΠ΅ Π½ΡΠΆΠ½ΠΎ Π²ΡΠΏΠΎΠ»Π½ΠΈΡΡ Π΄ΠΎ ΡΡΠ°ΡΡΠ° ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ ΠΈΠ»ΠΈ ΠΏΡΠΈ Π΅Π³ΠΎ Π·Π°Π²Π΅ΡΡΠ΅Π½ΠΈΠΈ. ΠΡΠΈ ΡΡΠ½ΠΊΡΠΈΠΈ ΠΌΠΎΠΆΠ½ΠΎ ΠΎΠ±ΡΡΠ²ΠΈΡΡ Ρ `async def` ΠΈΠ»ΠΈ ΠΎΠ±ΡΡΠ½ΡΠΌ `def`. ### Π‘ΠΎΠ±ΡΡΠΈΠ΅ `startup` { #startup-event } Π§ΡΠΎΠ±Ρ Π΄ΠΎΠ±Π°Π²ΠΈΡΡ ΡΡΠ½ΠΊΡΠΈΡ, ΠΊΠΎΡΠΎΡΡΡ Π½ΡΠΆΠ½ΠΎ Π·Π°ΠΏΡΡΡΠΈΡΡ Π΄ΠΎ ΡΡΠ°ΡΡΠ° ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ, ΠΎΠ±ΡΡΠ²ΠΈΡΠ΅ Π΅Ρ ΠΊΠ°ΠΊ ΠΎΠ±ΡΠ°Π±ΠΎΡΡΠΈΠΊ ΡΠΎΠ±ΡΡΠΈΡ `"startup"`:Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 12.7K bytes - Viewed (0) -
docs_src/security/tutorial007_an_py39.py
import secrets from typing import Annotated from fastapi import Depends, FastAPI, HTTPException, status from fastapi.security import HTTPBasic, HTTPBasicCredentials app = FastAPI() security = HTTPBasic() def get_current_username( credentials: Annotated[HTTPBasicCredentials, Depends(security)], ): current_username_bytes = credentials.username.encode("utf8") correct_username_bytes = b"stanleyjobson"
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Mar 26 16:56:53 UTC 2024 - 1.1K bytes - Viewed (0)