- Sort Score
- Num 10 results
- Language All
Results 161 - 170 of 1,675 for tone (0.03 seconds)
-
docs_src/body_updates/tutorial002_py310.py
app = FastAPI() class Item(BaseModel): name: str | None = None description: str | None = None price: float | None = None tax: float = 10.5 tags: list[str] = [] items = { "foo": {"name": "Foo", "price": 50.2}, "bar": {"name": "Bar", "description": "The bartenders", "price": 62, "tax": 20.2}, "baz": {"name": "Baz", "description": None, "price": 50.2, "tax": 10.5, "tags": []}, }
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 20 15:55:38 GMT 2025 - 1022 bytes - Click Count (0) -
tests/benchmarks/test_general_performance.py
status_code, body = _bench_post_json( benchmark, client, "/sync/validated", json={"name": "foo", "value": 123}, ) assert status_code == 200 assert body == b'{"name":"foo","value":123,"dep":42}' def test_sync_return_dict_without_response_model(benchmark, client: TestClient) -> None:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 20:40:26 GMT 2025 - 11.1K bytes - Click Count (0) -
docs_src/security/tutorial005_py310.py
class Token(BaseModel): access_token: str token_type: str class TokenData(BaseModel): username: str | None = None scopes: list[str] = [] class User(BaseModel): username: str email: str | None = None full_name: str | None = None disabled: bool | None = None class UserInDB(User): hashed_password: str password_hash = PasswordHash.recommended()
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Mon Sep 29 02:57:38 GMT 2025 - 5.2K bytes - Click Count (0) -
tests/test_request_params/test_header/test_optional_str.py
# Without aliases @app.get("/optional-str") async def read_optional_str(p: Annotated[Optional[str], Header()] = None): return {"p": p} class HeaderModelOptionalStr(BaseModel): p: Optional[str] = None @app.get("/model-optional-str") async def read_model_optional_str(p: Annotated[HeaderModelOptionalStr, Header()]): return {"p": p.p}
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 8.2K bytes - Click Count (0) -
internal/event/target/redis.go
} return nil } func (r RedisArgs) validateFormat(c redis.Conn) error { typeAvailable, err := redis.String(c.Do("TYPE", r.Key)) if err != nil { return err } if typeAvailable != "none" { expectedType := "hash" if r.Format == event.AccessFormat { expectedType = "list" } if typeAvailable != expectedType {
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Sun Mar 30 00:56:02 GMT 2025 - 9.1K bytes - Click Count (0) -
fastapi/utils.py
model_config: Union[type[BaseConfig], None] = None, field_info: Optional[FieldInfo] = None, alias: Optional[str] = None, mode: Literal["validation", "serialization"] = "validation", version: Literal["1", "auto"] = "auto", ) -> ModelField: if annotation_is_pydantic_v1(type_): raise PydanticV1NotSupportedError( "pydantic.v1 models are no longer supported by FastAPI."
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 5.1K bytes - Click Count (0) -
docs_src/schema_extra_example/tutorial005_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( openapi_examples={ "normal": { "summary": "A normal example",
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Aug 26 18:03:13 GMT 2023 - 1.3K bytes - Click Count (0) -
docs_src/websockets/tutorial002_an_py310.py
@app.get("/") async def get(): return HTMLResponse(html) async def get_cookie_or_token( websocket: WebSocket, session: Annotated[str | None, Cookie()] = None, token: Annotated[str | None, Query()] = None, ): if session is None and token is None: raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION) return session or token @app.websocket("/items/{item_id}/ws")
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 2.8K bytes - Click Count (0) -
docs_src/websockets/tutorial002_py310.py
websocket: WebSocket, session: str | None = Cookie(default=None), token: str | None = Query(default=None), ): if session is None and token is None: raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION) return session or token @app.websocket("/items/{item_id}/ws") async def websocket_endpoint( websocket: WebSocket, item_id: str, q: int | None = None,Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 2.7K bytes - Click Count (0) -
docs/fr/docs/tutorial/query-params-str-validations.md
Le paramètre de requête `q` a pour type `Union[str, None]` (ou `str | None` en Python 3.10), signifiant qu'il est de type `str` mais pourrait aussi être égal à `None`, et bien sûr, la valeur par défaut est `None`, donc **FastAPI** saura qu'il n'est pas requis. /// note **FastAPI** saura que la valeur de `q` n'est pas requise grâce à la valeur par défaut `= None`.
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Nov 09 16:39:20 GMT 2024 - 9.5K bytes - Click Count (0)