- Sort Score
- Num 10 results
- Language All
Results 91 - 100 of 1,705 for nonce (0.02 seconds)
-
fastapi/dependencies/models.py
name: str | None = None call: Callable[..., Any] | None = None request_param_name: str | None = None websocket_param_name: str | None = None http_connection_param_name: str | None = None response_param_name: str | None = None background_tasks_param_name: str | None = None security_scopes_param_name: str | None = None own_oauth_scopes: list[str] | None = NoneCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Feb 11 18:41:21 GMT 2026 - 7.1K bytes - Click Count (0) -
tests/test_request_params/test_file/test_optional_list.py
@app.post("/optional-list-bytes") async def read_optional_list_bytes(p: Annotated[list[bytes] | None, File()] = None): return {"file_size": [len(file) for file in p] if p else None} @app.post("/optional-list-uploadfile") async def read_optional_list_uploadfile( p: Annotated[list[UploadFile] | None, File()] = None, ): return {"file_size": [file.size for file in p] if p else None} @pytest.mark.parametrize( "path", [
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 21 13:01:31 GMT 2026 - 10.8K bytes - Click Count (0) -
docs_src/body_multiple_params/tutorial003_an_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 class User(BaseModel): username: str full_name: str | None = None @app.put("/items/{item_id}") async def update_item( item_id: int, item: Item, user: User, importance: Annotated[int, Body()] ):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 550 bytes - Click Count (0) -
scripts/contributors.py
class ReviewNode(BaseModel): author: Author | None = None state: str class Reviews(BaseModel): nodes: list[ReviewNode] class PullRequestNode(BaseModel): number: int labels: Labels author: Author | None = None title: str createdAt: datetime lastEditedAt: datetime | None = None updatedAt: datetime | None = None state: str reviews: Reviews
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Dec 16 12:34:01 GMT 2025 - 8.6K bytes - Click Count (0) -
docs/ko/docs/advanced/advanced-python-types.md
예를 들어, 어떤 값이 `str` 또는 `None`이 될 수 있다고 선언할 수 있습니다: ```python from typing import Union def say_hi(name: Union[str, None]): print(f"Hi {name}!") ``` `typing`에는 `None`이 될 수 있음을 선언하는 축약형으로 `Optional`도 있습니다. 아주 개인적인 관점에서의 팁입니다: - 🚨 `Optional[SomeType]` 사용은 피하세요 - 대신 ✨ **`Union[SomeType, None]`를 사용하세요** ✨.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:57:01 GMT 2026 - 2.4K bytes - Click Count (0) -
tests/test_request_params/test_body/test_optional_list.py
# Without aliases @app.post("/optional-list-str", operation_id="optional_list_str") async def read_optional_list_str( p: Annotated[list[str] | None, Body(embed=True)] = None, ): return {"p": p} class BodyModelOptionalListStr(BaseModel): p: list[str] | None = None @app.post("/model-optional-list-str", operation_id="model_optional_list_str") async def read_model_optional_list_str(p: BodyModelOptionalListStr):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 12.6K bytes - Click Count (0) -
tests/test_pydantic_v1_error.py
def test_raises_pydantic_v1_model_in_endpoint_param() -> None: class ParamModelV1(BaseModel): name: str app = FastAPI() with pytest.raises(PydanticV1NotSupportedError): @app.post("/param") def endpoint(data: ParamModelV1): # pragma: no cover return data def test_raises_pydantic_v1_model_in_return_type() -> None: class ReturnModelV1(BaseModel): name: str
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 2.3K 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[str | None, Header()] = None): return {"p": p} class HeaderModelOptionalStr(BaseModel): p: str | None = None @app.get("/model-optional-str") async def read_model_optional_str(p: Annotated[HeaderModelOptionalStr, Header()]): return {"p": 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) -
scripts/translate.py
print("LLM translatable languages:", translatable_langs) return translatable_langs @app.command() def llm_translatable_json( language: Annotated[str | None, typer.Option(envvar="LANGUAGE")] = None, ) -> None: translatable_langs = get_llm_translatable() if language: if language in translatable_langs: print(json.dumps([language])) return else:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:37:41 GMT 2026 - 15.8K bytes - Click Count (0) -
fastapi/sse.py
""" ), ] = None event: Annotated[ str | None, Doc( """ Optional event type name. Maps to `addEventListener(event, ...)` on the browser. When omitted, the browser dispatches on the generic `message` event. """ ), ] = None id: Annotated[ str | None, AfterValidator(_check_id_no_null),Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 09:21:52 GMT 2026 - 6.2K bytes - Click Count (0)