Skip to content

Conversation

@coleleavitt
Copy link
Contributor

Summary

Updates @hey-api/openapi-ts from 0.88.1 to 0.90.4 which includes a fix for the "Unexpected end of JSON input" error.

Fixes #7889
Fixes #7715

Problem

When servers return HTTP 200 with no Content-Length header and an empty body, response.json() throws:

Unexpected end of JSON input

Solution

The fix was already implemented upstream in hey-api/openapi-ts#3201 and released in v0.90.4.

The generated client now handles this case:

case 'json': {
  // response.json() would throw; read as text and parse if non-empty.
  const text = await response.text();
  data = text ? JSON.parse(text) : {};
  break;
}

Changes

  • Updated @hey-api/openapi-ts from 0.88.10.90.4
  • Regenerated SDK with the fix included
  • All typechecks pass

Related

This supersedes the manual fix in PR #7888 for the SDK portion - the storage layer fixes in that PR are still needed separately.

Fixes empty JSON response parsing error. The new version includes
a fix for 'Unexpected end of JSON input' when servers return 200
with no Content-Length and empty body.

Fixes anomalyco#7889
Fixes anomalyco#7715
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found a related PR that should be noted:

Related PR:

The other search results (#8027, #7618, #7939, #7959, #8825) are related to JSON handling but appear to be addressing different issues (session files, RPC errors, TUI parsing) rather than being duplicates of the current PR.

No duplicate PRs found addressing the same @hey-api/openapi-ts dependency update.

@rekram1-node rekram1-node merged commit d075c09 into anomalyco:dev Jan 16, 2026
6 checks passed
rekram1-node added a commit that referenced this pull request Jan 16, 2026
@coleleavitt coleleavitt deleted the chore/update-hey-api-openapi-ts branch January 16, 2026 19:56
github-actions bot pushed a commit to yuguorui/opencode that referenced this pull request Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SDK throws 'Unexpected end of JSON input' on empty response bodies Unexpected end of json

2 participants