- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 23 for APIRoute (0.17 sec)
-
docs/de/docs/how-to/custom-request-and-route.md
# Benutzerdefinierte Request- und APIRoute-Klasse In einigen Fällen möchten Sie möglicherweise die von den Klassen `Request` und `APIRoute` verwendete Logik überschreiben. Das kann insbesondere eine gute Alternative zur Logik in einer Middleware sein. Wenn Sie beispielsweise den Requestbody lesen oder manipulieren möchten, bevor er von Ihrer Anwendung verarbeitet wird. /// danger | "Gefahr" Dies ist eine „fortgeschrittene“ Funktion.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 5.2K bytes - Viewed (0) -
docs/pt/docs/how-to/custom-request-and-route.md
# Requisições Personalizadas e Classes da APIRoute Em algum casos, você pode querer sobreescrever a lógica usada pelas classes `Request`e `APIRoute`. Em particular, isso pode ser uma boa alternativa para uma lógica em um middleware Por exemplo, se você quiser ler ou manipular o corpo da requisição antes que ele seja processado pela sua aplicação. /// danger | Perigo Isso é um recurso "avançado".
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Oct 22 17:33:00 UTC 2024 - 4.9K bytes - Viewed (0) -
tests/test_custom_route_class.py
import pytest from fastapi import APIRouter, FastAPI from fastapi.routing import APIRoute from fastapi.testclient import TestClient 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)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.1K bytes - Viewed (0) -
tests/test_route_scope.py
import pytest from fastapi import FastAPI, Request, WebSocket, WebSocketDisconnect from fastapi.routing import APIRoute, APIWebSocketRoute from fastapi.testclient import TestClient app = FastAPI() @app.get("/users/{user_id}") async def get_user(user_id: str, request: Request): route: APIRoute = request.scope["route"] return {"user_id": user_id, "path": route.path} @app.websocket("/items/{item_id}")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Feb 08 10:23:07 UTC 2023 - 1.5K bytes - Viewed (0) -
docs/em/docs/how-to/custom-request-and-route.md
# 🛃 📨 & APIRoute 🎓 💼, 👆 5️⃣📆 💚 🔐 ⚛ ⚙️ `Request` & `APIRoute` 🎓. 🎯, 👉 5️⃣📆 👍 🎛 ⚛ 🛠️. 🖼, 🚥 👆 💚 ✍ ⚖️ 🔬 📨 💪 ⏭ ⚫️ 🛠️ 👆 🈸. /// danger 👉 "🏧" ⚒. 🚥 👆 ▶️ ⏮️ **FastAPI** 👆 💪 💚 🚶 👉 📄. /// ## ⚙️ 💼 ⚙️ 💼 🔌: * 🏭 🚫-🎻 📨 💪 🎻 (✅ <a href="https://msgpack.org/index.html" class="external-link" target="_blank">`msgpack`</a>). * 🗜 🗜-🗜 📨 💪. * 🔁 🚨 🌐 📨 💪.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.6K bytes - Viewed (0) -
docs/en/docs/how-to/custom-request-and-route.md
# Custom Request and APIRoute class In some cases, you may want to override the logic used by the `Request` and `APIRoute` classes. In particular, this may be a good alternative to logic in a middleware. For example, if you want to read or manipulate the request body before it is processed by your application. /// danger This is an "advanced" feature. If you are just starting with **FastAPI** you might want to skip this section. ///
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 22:39:38 UTC 2024 - 4.3K bytes - Viewed (0) -
tests/test_generate_unique_id_function.py
from fastapi import APIRouter, FastAPI from fastapi.routing import APIRoute from fastapi.testclient import TestClient from pydantic import BaseModel def custom_generate_unique_id(route: APIRoute): return f"foo_{route.name}" def custom_generate_unique_id2(route: APIRoute): return f"bar_{route.name}" def custom_generate_unique_id3(route: APIRoute): return f"baz_{route.name}" class Item(BaseModel):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Jan 13 15:10:26 UTC 2024 - 66.7K bytes - Viewed (0) -
fastapi/openapi/utils.py
def generate_operation_summary(*, route: routing.APIRoute, method: str) -> str: if route.summary: return route.summary return route.name.replace("_", " ").title() def get_openapi_operation_metadata( *, route: routing.APIRoute, method: str, operation_ids: Set[str] ) -> Dict[str, Any]: operation: Dict[str, Any] = {} if route.tags:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Sep 17 18:54:10 UTC 2024 - 22.6K bytes - Viewed (0) -
fastapi/utils.py
from pydantic import BaseModel, create_model from pydantic.fields import FieldInfo from typing_extensions import Literal if TYPE_CHECKING: # pragma: nocover from .routing import APIRoute # Cache for `create_cloned_field` _CLONED_TYPES_CACHE: MutableMapping[Type[BaseModel], Type[BaseModel]] = ( WeakKeyDictionary() )
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 31 23:46:03 UTC 2024 - 7.8K bytes - Viewed (0) -
fastapi/routing.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Oct 12 09:44:57 UTC 2024 - 172.1K bytes - Viewed (0)