From 752a95168fd85f6def10114ca985437686130a67 Mon Sep 17 00:00:00 2001 From: FrancescoSaverioZuppichini Date: Tue, 21 Apr 2026 15:18:51 +0200 Subject: [PATCH 1/2] fix: HealthResponse no longer contains non-existent `services` field /health returns only { status, uptime }. The HealthServices subtype (redis/db status) was never returned by the API. Removed both the field and the HealthServices class. Verified against live endpoint: curl https://v2-api.scrapegraphai.com/api/health -> {"status": "ok", "uptime": 17936} Co-Authored-By: Claude Opus 4.7 (1M context) --- src/scrapegraph_py/schemas.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/scrapegraph_py/schemas.py b/src/scrapegraph_py/schemas.py index 3cb37bd..e2970d1 100644 --- a/src/scrapegraph_py/schemas.py +++ b/src/scrapegraph_py/schemas.py @@ -471,14 +471,8 @@ class CreditsResponse(ResponseModel): model_config = ConfigDict(extra="allow") -class HealthServices(ResponseModel): - redis: Literal["ok", "down"] - db: Literal["ok", "down"] - - class HealthResponse(ResponseModel): status: str uptime: int - services: HealthServices | None = None model_config = ConfigDict(extra="allow") From 1882306465b454f6336b6879b01aee43a38467bc Mon Sep 17 00:00:00 2001 From: FrancescoSaverioZuppichini Date: Tue, 21 Apr 2026 15:22:31 +0200 Subject: [PATCH 2/2] fix: narrow HealthResponse.status to Literal["ok", "degraded"] Server only ever emits one of these two values (ok when redis+db are both reachable, degraded when either ping fails). Reference: apps/api/src/routes/health/index.ts:21 in sgai-api-v2-clean. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/scrapegraph_py/schemas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scrapegraph_py/schemas.py b/src/scrapegraph_py/schemas.py index e2970d1..ba7644c 100644 --- a/src/scrapegraph_py/schemas.py +++ b/src/scrapegraph_py/schemas.py @@ -472,7 +472,7 @@ class CreditsResponse(ResponseModel): class HealthResponse(ResponseModel): - status: str + status: Literal["ok", "degraded"] uptime: int model_config = ConfigDict(extra="allow")