- Sort Score
- Result 10 results
- Languages All
Results 151 - 160 of 529 for unionOf (0.15 sec)
-
docs_src/schema_extra_example/tutorial001_pv1.py
from typing import Union from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None class Config: schema_extra = { "examples": [ { "name": "Foo", "description": "A very nice Item",
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 669 bytes - Viewed (0) -
docs_src/schema_extra_example/tutorial003_an_py39.py
from typing import Annotated, Union from fastapi import Body, FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None @app.put("/items/{item_id}") async def update_item( item_id: int, item: Annotated[ Item, Body( examples=[ {
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 692 bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial014_an_py39.py
from typing import Annotated, Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( hidden_query: Annotated[Union[str, None], Query(include_in_schema=False)] = None, ): if hidden_query: return {"hidden_query": hidden_query} else:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Mar 26 16:56:53 UTC 2024 - 344 bytes - Viewed (0) -
docs_src/response_model/tutorial001_py39.py
from typing import Any, Union from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[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])
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Jan 07 13:45:48 UTC 2023 - 556 bytes - Viewed (0) -
docs_src/schema_extra_example/tutorial003_an.py
from typing import Union from fastapi import Body, FastAPI from pydantic import BaseModel from typing_extensions import Annotated app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None @app.put("/items/{item_id}") async def update_item( item_id: int, item: Annotated[ Item, Body(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 721 bytes - Viewed (0) -
docs_src/python_types/tutorial011_py39.py
from datetime import datetime from typing import Union from pydantic import BaseModel class User(BaseModel): id: int name: str = "John Doe" signup_ts: Union[datetime, None] = None friends: list[int] = [] external_data = { "id": "123", "signup_ts": "2017-06-01 12:22", "friends": [1, "2", b"3"], } user = User(**external_data) print(user)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Sep 02 15:56:35 UTC 2023 - 492 bytes - Viewed (0) -
docs_src/separate_openapi_schemas/tutorial001.py
from typing import List, Union from fastapi import FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: Union[str, None] = None app = FastAPI() @app.post("/items/") def create_item(item: Item): return item @app.get("/items/") def read_items() -> List[Item]: return [ Item( name="Portal Gun",
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Aug 25 19:10:22 UTC 2023 - 489 bytes - Viewed (0) -
docs/em/docs/python-types.md
``` //// #### βοΈ `Union` βοΈ `Optional` π₯ π βοΈ π β¬ π 3οΈβ£.1οΈβ£0οΈβ£, π₯ πββ βͺοΈβ‘οΈ π πΆ **π€** β π: * πΆ β βοΈ `Optional[SomeType]` * β©οΈ πΆ **βοΈ `Union[SomeType, None]`** πΆ. π―ββοΈ π & π π« π, βοΈ π€ π π `Union` β©οΈ `Optional` β©οΈ π€ "**π¦**" π π π π π² π¦, & β«οΈ π€ β "β«οΈ πͺ `None`", π₯ β«οΈ π« π¦ & β. π€ π `Union[SomeType, None]` π π π β«οΈβ β«οΈ β.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 13.4K bytes - Viewed (0) -
docs/em/docs/tutorial/query-params-str-validations.md
```Python hl_lines="7" {!> ../../docs_src/query_params_str_validations/tutorial001_py310.py!} ``` //// π’ π’ `q` π `Union[str, None]` (βοΈ `str | None` π 3οΈβ£.1οΈβ£0οΈβ£), π β π β«οΈ π `str` βοΈ πͺ `None`, & π, π’ π² `None`, FastAPI π π β«οΈ π« β. /// note FastAPI π π π π² `q` π« β β©οΈ π’ π² `= None`. `Union` `Union[str, None]` π β π π¨βπ¨ π€ π π πβπ¦Ί & π β. /// ## π π¬
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 11.7K bytes - Viewed (0) -
docs/pt/docs/tutorial/query-params-str-validations.md
``` O parÒmetro de consulta `q` é do tipo `Union[str, None]`, o que significa que é do tipo `str` mas que também pode ser `None`, e de fato, o valor padrão é `None`, então o FastAPI saberÑ que não é obrigatório. /// note | "Observação" O FastAPI saberÑ que o valor de `q` não é obrigatório por causa do valor padrão `= None`.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 9.3K bytes - Viewed (0)