- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for classof (0.16 sec)
-
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 May 05 07:19:11 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 May 05 07:19:11 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 May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.5K bytes - Viewed (0) -
fastapi/security/oauth2.py
client_secret=client_secret, ) class OAuth2(SecurityBase): """ This is the base class for OAuth2 authentication, an instance of it would be used as a dependency. All other OAuth2 classes inherit from it and customize it for each OAuth2 flow. You normally would not create a new class inheriting from it but use one of the
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Apr 02 02:48:51 GMT 2024 - 21.1K bytes - Viewed (1) -
fastapi/openapi/utils.py
if isinstance(route.response_class, DefaultPlaceholder): current_response_class: Type[Response] = route.response_class.value else: current_response_class = route.response_class assert current_response_class, "A response class is needed to generate OpenAPI" route_response_media_type: Optional[str] = current_response_class.media_type if route.include_in_schema:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 21.8K bytes - Viewed (0) -
tests/test_param_class.py
Sebastián RamÃrez <******@****.***> 1652485102 -0500
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 636 bytes - Viewed (0) -
tests/test_inherited_custom_class.py
return {"fast_uuid": asyncpg_uuid} class SomeCustomClass(BaseModel): class Config: arbitrary_types_allowed = True json_encoders = {uuid.UUID: str} a_uuid: MyUuid @app.get("/get_custom_class") def return_some_user(): # Test that the fix also works for custom pydantic classes
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 3K bytes - Viewed (0) -
tests/test_response_class_no_mediatype.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=Response, responses={500: {"description": "Error", "model": JsonApiError}}, )
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.3K bytes - Viewed (0) -
fastapi/encoders.py
} def generate_encoders_by_class_tuples( type_encoder_map: Dict[Any, Callable[[Any], Any]], ) -> Dict[Callable[[Any], Any], Tuple[Any, ...]]: encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict( tuple ) for type_, encoder in type_encoder_map.items(): encoders_by_class_tuples[encoder] += (type_,) return encoders_by_class_tuples
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 21:56:59 GMT 2024 - 10.8K bytes - Viewed (0)