Skip to content

fix(openapi-generator): route void error responses to the error channel#6403

Open
craigsmitham wants to merge 1 commit into
Effect-TS:mainfrom
craigsmitham:craig/fix-openapi-void-errors
Open

fix(openapi-generator): route void error responses to the error channel#6403
craigsmitham wants to merge 1 commit into
Effect-TS:mainfrom
craigsmitham:craig/fix-openapi-void-errors

Conversation

@craigsmitham

Copy link
Copy Markdown
Contributor

Summary

  • classify bodiless 4xx and 5xx OpenAPI responses as typed client errors
  • preserve bodiless 2xx responses in the success channel
  • cover schema-backed and type-only generated clients

Closes #6373.

Validation

  • pnpm test packages/tools/openapi-generator/test/OpenApiGenerator.test.ts
  • pnpm lint-fix
  • pnpm check

When an OpenAPI response has no content body (common for HEAD endpoints),
the generator previously mapped all status codes to `() => Effect.void`,
erasing the distinction between success (200) and error (404, 500).

This change routes 4xx/5xx void schemas to the error channel via a new
`decodeVoidError` helper, producing typed `ClientError<"status", undefined>`
values. 2xx void schemas remain in the success channel as `Effect.void`.

Affects both `httpclient` and `httpclient-type-only` formats.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog Jul 14, 2026
@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3855fc2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
@effect/openapi-generator Patch
effect Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@IMax153 IMax153 added bug Something isn't working 4.0 labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0 bug Something isn't working

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

@effect/openapi-generator: httpclient format routes 4xx/5xx bodiless responses to success channel instead of error channel

2 participants