ValidationErrorLoggingRoute Class — fastapi Architecture
Architecture documentation for the ValidationErrorLoggingRoute class in tutorial002_an_py310.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 9dda2b47_091e_da54_5562_3b05e7817133["ValidationErrorLoggingRoute"] aa28685f_bb97_e988_ff40_3e5385960f32["APIRoute"] 9dda2b47_091e_da54_5562_3b05e7817133 -->|extends| aa28685f_bb97_e988_ff40_3e5385960f32 20502214_d6d6_2052_679f_afae0f3867db["tutorial002_an_py310.py"] 9dda2b47_091e_da54_5562_3b05e7817133 -->|defined in| 20502214_d6d6_2052_679f_afae0f3867db 4e083208_d1cb_8c30_4934_6afea76257ab["get_route_handler()"] 9dda2b47_091e_da54_5562_3b05e7817133 -->|method| 4e083208_d1cb_8c30_4934_6afea76257ab
Relationship Graph
Source Code
docs_src/custom_request_and_route/tutorial002_an_py310.py lines 9–21
class ValidationErrorLoggingRoute(APIRoute):
def get_route_handler(self) -> Callable:
original_route_handler = super().get_route_handler()
async def custom_route_handler(request: Request) -> Response:
try:
return await original_route_handler(request)
except RequestValidationError as exc:
body = await request.body()
detail = {"errors": exc.errors(), "body": body.decode()}
raise HTTPException(status_code=422, detail=detail)
return custom_route_handler
Domain
Extends
Source
Frequently Asked Questions
What is the ValidationErrorLoggingRoute class?
ValidationErrorLoggingRoute is a class in the fastapi codebase, defined in docs_src/custom_request_and_route/tutorial002_an_py310.py.
Where is ValidationErrorLoggingRoute defined?
ValidationErrorLoggingRoute is defined in docs_src/custom_request_and_route/tutorial002_an_py310.py at line 9.
What does ValidationErrorLoggingRoute extend?
ValidationErrorLoggingRoute extends APIRoute.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free