From 7e163f880f8f9a9075f535c8a762a6ba39ffafce Mon Sep 17 00:00:00 2001 From: Felipe Novaes F Rocha Date: Fri, 12 Jun 2026 16:23:04 -0300 Subject: [PATCH] fix: /api/v1/health returned 500 on every call It passed a pydantic model straight to JSONResponse, which cannot render it. Dump the model first. --- src/api/v1/health.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/v1/health.py b/src/api/v1/health.py index a00c5df..fb873fa 100644 --- a/src/api/v1/health.py +++ b/src/api/v1/health.py @@ -12,7 +12,8 @@ from node.api.serializers.health import HealthSerializer async def get(request: NBERequest) -> Response: response = await request.app.state.node_api.get_health() - return JSONResponse(response) + # JSONResponse can't render a pydantic model directly; dump it first. + return JSONResponse(response.model_dump(mode="json")) async def _create_health_stream(node_api: NodeApi, *, poll_interval_seconds: int = 10) -> AsyncIterator[Health]: