- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for JSONResponse (0.05 sec)
-
tests/test_additional_responses_custom_model_in_callback.py
from fastapi.testclient import TestClient from inline_snapshot import snapshot from pydantic import BaseModel, HttpUrl from starlette.responses import JSONResponse class CustomModel(BaseModel): a: int app = FastAPI() callback_router = APIRouter(default_response_class=JSONResponse) @callback_router.get( "{$callback_url}/callback/", responses={400: {"model": CustomModel}} ) def callback_route():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 5.8K bytes - Viewed (0) -
tests/test_extra_routes.py
return {"item_id": item_id, "item": item} @app.head("/items/{item_id}") def head_item(item_id: str): return JSONResponse(None, headers={"x-fastapi-item-id": item_id}) @app.options("/items/{item_id}") def options_item(item_id: str): return JSONResponse(None, headers={"x-fastapi-item-id": item_id}) @app.patch("/items/{item_id}") def patch_item(item_id: str, item: Item):Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 13.5K bytes - Viewed (0) -
fastapi/routing.py
from starlette._utils import is_async_callable from starlette.concurrency import run_in_threadpool from starlette.exceptions import HTTPException from starlette.requests import Request from starlette.responses import JSONResponse, Response from starlette.routing import ( BaseRoute, Match, compile_path, get_name, ) from starlette.routing import Mount as Mount # noqa
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 174.6K bytes - Viewed (0) -
fastapi/openapi/utils.py
from fastapi.utils import ( deep_dict_update, generate_operation_id_for_path, is_body_allowed_for_status_code, ) from pydantic import BaseModel from starlette.responses import JSONResponse from starlette.routing import BaseRoute from typing_extensions import Literal validation_error_definition = { "title": "ValidationError", "type": "object", "properties": { "loc": {
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 23.2K bytes - Viewed (0) -
tests/test_response_model_as_return_annotation.py
return Response(content="Foo") @app.get("/no_response_model-annotation_json_response_class") def no_response_model_annotation_json_response_class() -> JSONResponse: return JSONResponse(content={"foo": "bar"}) client = TestClient(app) def test_no_response_model_no_annotation_return_model(): response = client.get("/no_response_model-no_annotation-return_model")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 47.7K bytes - Viewed (0) -
docs/de/docs/tutorial/response-model.md
Und Tools werden auch glücklich sein, weil sowohl `RedirectResponse` als auch `JSONResponse` Unterklassen von `Response` sind, die Typannotation ist daher korrekt. ### Eine Unterklasse von Response annotieren { #annotate-a-response-subclass }Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 24 10:28:19 UTC 2025 - 17.5K bytes - Viewed (0) -
docs/en/docs/release-notes.md
## 0.51.0 * Re-export utils from Starlette: * This allows using things like `from fastapi.responses import JSONResponse` instead of `from starlette.responses import JSONResponse`. * It's mainly syntax sugar, a convenience for developer experience.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 19:06:15 UTC 2025 - 586.7K bytes - Viewed (0)