- Sort Score
- Num 10 results
- Language All
Results 981 - 990 of 4,691 for Done (0.02 seconds)
-
tests/main.py
@app.get("/query/optional") def get_query_optional(query=None): if query is None: return "foo bar" return f"foo bar {query}" @app.get("/query/int") def get_query_type(query: int): return f"foo bar {query}" @app.get("/query/int/optional") def get_query_type_optional(query: int | None = None): if query is None: return "foo bar" return f"foo bar {query}"
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 4.5K bytes - Click Count (0) -
docs_src/schema_extra_example/tutorial003_py310.py
from fastapi import Body, FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None @app.put("/items/{item_id}") async def update_item( item_id: int, item: Item = Body( examples=[ { "name": "Foo", "description": "A very nice Item",
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 574 bytes - Click Count (0) -
tests/test_security_api_key_header_optional.py
class User(BaseModel): username: str def get_current_user(oauth_header: str | None = Security(api_key)): if oauth_header is None: return None user = User(username=oauth_header) return user @app.get("/users/me") def read_current_user(current_user: User | None = Depends(get_current_user)): if current_user is None: return {"msg": "Create an account first"} return current_user
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 2.1K bytes - Click Count (0) -
docs_src/schema_extra_example/tutorial003_an_py310.py
from typing import Annotated from fastapi import Body, FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None @app.put("/items/{item_id}") async def update_item( item_id: int, item: Annotated[ Item, Body( examples=[ {
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 673 bytes - Click Count (0) -
docs_src/cookie_param_models/tutorial002_an_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Sep 17 18:54:10 GMT 2024 - 383 bytes - Click Count (0) -
docs_src/header_param_models/tutorial003_py310.py
from fastapi import FastAPI, Header from pydantic import BaseModel app = FastAPI() class CommonHeaders(BaseModel): host: str save_data: bool if_modified_since: str | None = None traceparent: str | None = None x_tag: list[str] = [] @app.get("/items/") async def read_items(headers: CommonHeaders = Header(convert_underscores=False)):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 23 20:48:54 GMT 2025 - 377 bytes - Click Count (0) -
build-logic/build-update-utils/src/main/kotlin/gradlebuild/buildutils/runtimes/CheckTargetRuntimes.kt
) { val failures = projects .filter { (path, _) -> !computedTargetRuntimes.containsKey(path) } .filter { (path, _) -> projects.none { (_, value) -> value.details.dependencies.contains(path) } } .map { (path, info) -> "Project $path: ${info.buildFile.asClickableFileUrl()}" } if (failures.isNotEmpty()) {Created: Wed Apr 01 11:36:16 GMT 2026 - Last Modified: Wed Mar 11 22:40:18 GMT 2026 - 13.8K bytes - Click Count (0) -
docs_src/dependency_testing/tutorial001_an_py310.py
async def override_dependency(q: str | None = None): return {"q": q, "skip": 5, "limit": 10} app.dependency_overrides[common_parameters] = override_dependency def test_override_in_items(): response = client.get("/items/") assert response.status_code == 200 assert response.json() == { "message": "Hello Items!", "params": {"q": None, "skip": 5, "limit": 10}, }
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 1.5K bytes - Click Count (0) -
docs_src/response_model/tutorial001_py310.py
from typing import Any from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None tags: list[str] = [] @app.post("/items/", response_model=Item) async def create_item(item: Item) -> Any: return item @app.get("/items/", response_model=list[Item])
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Jan 07 13:45:48 GMT 2023 - 537 bytes - Click Count (0) -
docs_src/header_param_models/tutorial003_an_py310.py
from fastapi import FastAPI, Header from pydantic import BaseModel app = FastAPI() class CommonHeaders(BaseModel): host: str save_data: bool if_modified_since: str | None = None traceparent: str | None = None x_tag: list[str] = [] @app.get("/items/") async def read_items( headers: Annotated[CommonHeaders, Header(convert_underscores=False)], ):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 23 20:48:54 GMT 2025 - 424 bytes - Click Count (0)