- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 152 for typings (0.18 sec)
-
docs_src/query_params_str_validations/tutorial003_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)] = None, ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q})
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 372 bytes - Viewed (0) -
docs_src/schema_extra_example/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 @app.put("/items/{item_id}") async def update_item( *, item_id: int, item: Annotated[ Item, Body(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Jul 01 16:43:29 GMT 2023 - 965 bytes - Viewed (0) -
tests/test_ws_dependencies.py
import json from typing import List from fastapi import APIRouter, Depends, FastAPI, WebSocket from fastapi.testclient import TestClient from typing_extensions import Annotated def dependency_list() -> List[str]: return [] DepList = Annotated[List[str], Depends(dependency_list)] def create_dependency(name: str): def fun(deps: DepList): deps.append(name) return Depends(fun)
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sun Jun 11 20:35:39 GMT 2023 - 2.1K bytes - Viewed (0) -
tests/test_additional_responses_response_class.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",
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.5K bytes - Viewed (0) -
tests/test_response_code_no_body.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",
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.2K bytes - Viewed (0) -
docs_src/security/tutorial004_an.py
from datetime import datetime, timedelta, timezone from typing import Union from fastapi import Depends, FastAPI, HTTPException, status from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm from jose import JWTError, jwt from passlib.context import CryptContext from pydantic import BaseModel from typing_extensions import Annotated # to get a string like this run: # openssl rand -hex 32
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 4.1K bytes - Viewed (0) -
tests/test_request_body_parameters_media_type.py
import typing from fastapi import Body, FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() media_type = "application/vnd.api+json" # NOTE: These are not valid JSON:API resources # but they are fine for testing requestBody with custom media_type class Product(BaseModel): name: str price: float class Shop(BaseModel): name: str @app.post("/products")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 6.4K bytes - Viewed (0) -
docs_src/body/tutorial003.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 09 14:28:58 GMT 2024 - 362 bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial003.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 329 bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial003_an_py310.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 330 bytes - Viewed (0)