Skip to content

fix: drop non-existent services field from HealthResponse#89

Merged
FrancescoSaverioZuppichini merged 2 commits intomainfrom
fix/health-response-types
Apr 21, 2026
Merged

fix: drop non-existent services field from HealthResponse#89
FrancescoSaverioZuppichini merged 2 commits intomainfrom
fix/health-response-types

Conversation

@FrancescoSaverioZuppichini
Copy link
Copy Markdown
Member

Summary

The /health endpoint only returns { status, uptime }. The SDK's HealthResponse claimed a third services: HealthServices | None field (with redis + db status) that the API never returns.

Verified against live endpoint

$ curl -s https://v2-api.scrapegraphai.com/api/health
{"status": "ok", "uptime": 17936}

Changes

  • HealthResponse drops the services field
  • HealthServices class deleted (dead code after the field removal)

Breaking change?

Technically yes — but the field was always None in practice since the API never populated it. Any code accessing res.data.services was always getting None or a type error. Safe to ship in a patch/minor.

Test plan

  • uv run ruff format src tests clean
  • uv run ruff check src tests clean
  • 28/28 unit tests pass
  • uv build succeeds
  • Manually confirmed live API response shape

🤖 Generated with Claude Code

/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) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

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) <noreply@anthropic.com>
@FrancescoSaverioZuppichini FrancescoSaverioZuppichini merged commit e965ee0 into main Apr 21, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.1.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant