- Sort Score
- Num 10 results
- Language All
Results 41 - 50 of 271 for BaseModel (0.07 seconds)
-
docs_src/body_multiple_params/tutorial002_py310.py
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 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):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 446 bytes - Click Count (0) -
docs_src/security/tutorial004_an_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 18:10:35 GMT 2026 - 4.2K bytes - Click Count (0) -
docs_src/separate_openapi_schemas/tutorial001_py310.py
from fastapi import FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: 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", description="Device to travel through the multi-rick-verse",
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Aug 25 19:10:22 GMT 2023 - 451 bytes - Click Count (0) -
docs_src/body_nested_models/tutorial006_py310.py
from fastapi import FastAPI from pydantic import BaseModel, HttpUrl app = FastAPI() class Image(BaseModel): url: HttpUrl name: str class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None tags: set[str] = set() images: list[Image] | None = None @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 475 bytes - Click Count (0) -
docs_src/separate_openapi_schemas/tutorial002_py310.py
from fastapi import FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: str | None = None app = FastAPI(separate_input_output_schemas=False) @app.post("/items/") def create_item(item: Item): return item @app.get("/items/") def read_items() -> list[Item]: return [ Item( name="Portal Gun",
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Aug 25 19:10:22 GMT 2023 - 486 bytes - Click Count (0) -
docs_src/server_sent_events/tutorial002_py310.py
from collections.abc import AsyncIterable from fastapi import FastAPI from fastapi.sse import EventSourceResponse, ServerSentEvent from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str price: float items = [ Item(name="Plumbus", price=32.99), Item(name="Portal Gun", price=999.99), Item(name="Meeseeks Box", price=49.99), ]
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 09:21:52 GMT 2026 - 686 bytes - Click Count (0) -
docs_src/query_param_models/tutorial002_an_py310.py
from typing import Annotated, Literal from fastapi import FastAPI, Query from pydantic import BaseModel, Field app = FastAPI() class FilterParams(BaseModel): model_config = {"extra": "forbid"} limit: int = Field(100, gt=0, le=100) offset: int = Field(0, ge=0) order_by: Literal["created_at", "updated_at"] = "created_at" tags: list[str] = [] @app.get("/items/")
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Sep 17 18:54:10 GMT 2024 - 483 bytes - Click Count (0) -
docs_src/schema_extra_example/tutorial002_py310.py
from fastapi import FastAPI from pydantic import BaseModel, Field app = FastAPI() class Item(BaseModel): name: str = Field(examples=["Foo"]) description: str | None = Field(default=None, examples=["A very nice Item"]) price: float = Field(examples=[35.4]) tax: float | None = Field(default=None, examples=[3.2]) @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 479 bytes - Click Count (0) -
docs_src/body_multiple_params/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 class User(BaseModel): username: str full_name: str | None = None @app.put("/items/{item_id}") async def update_item(
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 550 bytes - Click Count (0) -
docs_src/path_operation_configuration/tutorial003_py310.py
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: set[str] = set() @app.post( "/items/", summary="Create an item", description="Create an item with all the information, name, description, price, tax and a set of unique tags", )
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Feb 04 12:07:26 GMT 2026 - 457 bytes - Click Count (0)