- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 448 for Lyding (0.17 sec)
-
docs_src/query_params_str_validations/tutorial002_an.py
from typing import Union from fastapi import FastAPI, Query from typing_extensions import Annotated app = FastAPI() @app.get("/items/") async def read_items(q: Annotated[Union[str, None], Query(max_length=50)] = None): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q})
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 351 bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial004_an.py
from typing import Union from fastapi import FastAPI, Query from typing_extensions import Annotated app = FastAPI() @app.get("/items/") async def read_items( q: Annotated[ Union[str, None], Query(min_length=3, max_length=50, pattern="^fixedquery$") ] = None, ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q})
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 410 bytes - Viewed (0) -
docs_src/body_fields/tutorial001_an.py
from typing import Union from fastapi import Body, FastAPI from pydantic import BaseModel, Field from typing_extensions import Annotated app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = Field( default=None, title="The description of the item", max_length=300 ) price: float = Field(gt=0, description="The price must be greater than zero") tax: Union[float, None] = None
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 611 bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial004_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 class User(BaseModel): username: str full_name: Union[str, None] = None @app.put("/items/{item_id}") async def update_item(
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 703 bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial010_an.py
from typing import Union from fastapi import FastAPI, Query from typing_extensions import Annotated app = FastAPI() @app.get("/items/") async def read_items( q: Annotated[ Union[str, None], Query( alias="item-query", title="Query string", description="Query string for the items to search in the database that have a good match", min_length=3,
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 664 bytes - Viewed (0) -
tests/test_additional_responses_custom_validationerror.py
import typing from fastapi import FastAPI from fastapi.responses import JSONResponse from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class JsonApiResponse(JSONResponse): media_type = "application/vnd.api+json" class Error(BaseModel): status: str title: str class JsonApiError(BaseModel): errors: typing.List[Error] @app.get( "/a/{id}",
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2.9K bytes - Viewed (0) -
docs_src/extra_models/tutorial005.py
from typing import Dict from fastapi import FastAPI app = FastAPI() @app.get("/keyword-weights/", response_model=Dict[str, float]) async def read_keyword_weights():
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 205 bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial011_py39.py
from typing import Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: Union[list[str], None] = Query(default=None)): query_items = {"q": q}
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 221 bytes - Viewed (0) -
docs_src/header_params/tutorial002_an_py310.py
from typing import Annotated from fastapi import FastAPI, Header app = FastAPI() @app.get("/items/") async def read_items( strange_header: Annotated[str | None, Header(convert_underscores=False)] = None, ):
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 261 bytes - Viewed (0) -
docs_src/security/tutorial006_an_py39.py
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 361 bytes - Viewed (0)