- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 360 for Clauss (0.16 sec)
-
tests/test_dependency_class.py
app = FastAPI() class CallableDependency: def __call__(self, value: str) -> str: return value class CallableGenDependency: def __call__(self, value: str) -> Generator[str, None, None]: yield value class AsyncCallableDependency: async def __call__(self, value: str) -> str: return value class AsyncCallableGenDependency:
Python - Registered: Sun Mar 24 07:19:08 GMT 2024 - Last Modified: Sun Aug 09 10:54:05 GMT 2020 - 3.3K bytes - Viewed (0) -
tests/test_custom_route_class.py
from starlette.routing import Route app = FastAPI() class APIRouteA(APIRoute): x_type = "A" class APIRouteB(APIRoute): x_type = "B" class APIRouteC(APIRoute): x_type = "C" router_a = APIRouter(route_class=APIRouteA) router_b = APIRouter(route_class=APIRouteB) router_c = APIRouter(route_class=APIRouteC) @router_a.get("/") def get_a(): return {"msg": "A"}
Python - Registered: Sun Mar 24 07:19:08 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.1K bytes - Viewed (0) -
tests/test_orjson_response_class.py
from fastapi import FastAPI from fastapi.responses import ORJSONResponse from fastapi.testclient import TestClient from sqlalchemy.sql.elements import quoted_name app = FastAPI(default_response_class=ORJSONResponse) @app.get("/orjson_non_str_keys") def get_orjson_non_str_keys(): key = quoted_name(value="msg", quote=False) return {key: "Hello World", 1: 1} client = TestClient(app) def test_orjson_non_str_keys():
Python - Registered: Sun Mar 24 07:19:08 GMT 2024 - Last Modified: Fri Sep 02 10:17:31 GMT 2022 - 562 bytes - Viewed (0) -
tests/test_additional_responses_response_class.py
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", response_class=JsonApiResponse, responses={500: {"description": "Error", "model": JsonApiError}}, )
Python - Registered: Sun Mar 24 07:19:08 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.5K bytes - Viewed (0) -
tests/test_jsonable_encoder.py
from .utils import needs_pydanticv1, needs_pydanticv2 class Person: def __init__(self, name: str): self.name = name class Pet: def __init__(self, owner: Person, name: str): self.owner = owner self.name = name @dataclass class Item: name: str count: int class DictablePerson(Person): def __iter__(self):
Python - Registered: Sun Mar 24 07:19:08 GMT 2024 - Last Modified: Wed Aug 02 15:28:34 GMT 2023 - 8.8K bytes - Viewed (0) -
docs_src/sql_databases/sql_app/schemas.py
from pydantic import BaseModel class ItemBase(BaseModel): title: str description: Union[str, None] = None class ItemCreate(ItemBase): pass class Item(ItemBase): id: int owner_id: int class Config: orm_mode = True class UserBase(BaseModel): email: str class UserCreate(UserBase): password: str class User(UserBase): id: int
Python - Registered: Sun Mar 24 07:19:08 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 502 bytes - Viewed (0) -
tests/test_response_model_data_filter.py
from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() class UserBase(BaseModel): email: str class UserCreate(UserBase): password: str class UserDB(UserBase): hashed_password: str class PetDB(BaseModel): name: str owner: UserDB class PetOut(BaseModel): name: str owner: UserBase
Python - Registered: Sun Mar 24 07:19:08 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 1.7K bytes - Viewed (0) -
docs_src/body_nested_models/tutorial007_py39.py
from pydantic import BaseModel, HttpUrl app = FastAPI() class Image(BaseModel): url: HttpUrl name: str class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None tags: set[str] = set() images: Union[list[Image], None] = None class Offer(BaseModel): name: str description: Union[str, None] = None
Python - Registered: Sun Mar 24 07:19:08 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 570 bytes - Viewed (0) -
docs_src/extra_models/tutorial003_py310.py
from typing import Union from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class BaseItem(BaseModel): description: str type: str class CarItem(BaseItem): type: str = "car" class PlaneItem(BaseItem): type: str = "plane" size: int items = { "item1": {"description": "All my friends drive a low rider", "type": "car"}, "item2": {
Python - Registered: Sun Mar 24 07:19:08 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 644 bytes - Viewed (0) -
fastapi/security/api_key.py
from starlette.requests import Request from starlette.status import HTTP_403_FORBIDDEN from typing_extensions import Annotated, Doc # type: ignore [attr-defined] class APIKeyBase(SecurityBase): pass class APIKeyQuery(APIKeyBase): """ API key authentication using a query parameter. This defines the name of the query parameter that should be provided in the request
Python - Registered: Sun Mar 24 07:19:08 GMT 2024 - Last Modified: Wed Oct 18 12:36:40 GMT 2023 - 9.2K bytes - Viewed (0)