- Sort Score
- Num 10 results
- Language All
Results 131 - 140 of 349 for unionOf (0.04 seconds)
-
docs_src/schema_extra_example/tutorial001_py39.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 model_config = { "json_schema_extra": { "examples": [ { "name": "Foo", "description": "A very nice Item",
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 684 bytes - Click Count (0) -
docs_src/query_params_str_validations/tutorial014_py39.py
from typing import Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( hidden_query: Union[str, None] = Query(default=None, include_in_schema=False), ): if hidden_query: return {"hidden_query": hidden_query} else:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 330 bytes - Click Count (0) -
docs_src/schema_extra_example/tutorial001_pv1_py39.py
from typing import Union from fastapi import FastAPI from pydantic.v1 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",
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 20 15:55:38 GMT 2025 - 672 bytes - Click Count (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=[ {
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 692 bytes - Click Count (0) -
docs_src/response_model/tutorial006_py39.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: float = 10.5 items = { "foo": {"name": "Foo", "price": 50.2}, "bar": {"name": "Bar", "description": "The Bar fighters", "price": 62, "tax": 20.2}, "baz": { "name": "Baz",
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 848 bytes - Click Count (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])
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Jan 07 13:45:48 GMT 2023 - 556 bytes - Click Count (0) -
docs_src/query_params/tutorial006_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 301 bytes - Click Count (0) -
docs_src/query_params_str_validations/tutorial003_an_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 343 bytes - Click Count (0) -
docs_src/query_params_str_validations/tutorial007_an_py39.py
from typing import Annotated, Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( q: Annotated[Union[str, None], Query(title="Query string", min_length=3)] = None, ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q})
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 350 bytes - Click Count (0) -
docs_src/schema_extra_example/tutorial004_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=[
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Jul 01 16:43:29 GMT 2023 - 936 bytes - Click Count (0)