Skip to content

exp: Simpler defaultResultHandler and status-encoded Client types - #3413

Draft
RobinTail wants to merge 35 commits into
masterfrom
simpler-default-result
Draft

exp: Simpler defaultResultHandler and status-encoded Client types#3413
RobinTail wants to merge 35 commits into
masterfrom
simpler-default-result

Conversation

@RobinTail

@RobinTail RobinTail commented May 23, 2026

Copy link
Copy Markdown
Owner

The idea is to change the payload of defaultResultHandler in order to make it smaller and simpler by removing the status: success | error discriminator as well as data | error wrapper. The status is already conveyed by the HTTP status code, so it is redundant.

That, however, requires to discriminate by the HTTP status on consumer side. Luckily, we do already have an entity called EncodedResponse (introduced as a result of #2219 discussion). With minor changes it can be used as a tuple-driven discriminator for the returns of Client::provide().

The whole change is breaking both for developers and the consumers of their APIs. Therefore a comprehensive migration path is required.

@RobinTail RobinTail added enhancement New feature or request breaking Backward incompatible changes labels May 23, 2026
@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fa7a10f2-c528-4761-b2ec-cf7dee29d87a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch simpler-default-result

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coveralls-official

coveralls-official Bot commented May 23, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — simpler-default-result into master

Comment thread example/index.spec.ts Outdated
Comment thread example/example.client.ts
@RobinTail
RobinTail force-pushed the simpler-default-result branch from 297a76d to de1a4c1 Compare July 5, 2026 18:36
RobinTail added 6 commits July 8, 2026 09:18
# Conflicts:
#	CHANGELOG.md
#	compat-test/eslint.config.js
#	compat-test/migration.spec.ts
#	compat-test/package.json
#	example/example.client.ts
#	example/example.documentation.yaml
#	express-zod-api/src/integration-base.ts
#	express-zod-api/src/integration.ts
#	express-zod-api/tests/__snapshots__/documentation.spec.ts.snap
#	express-zod-api/tests/__snapshots__/integration.spec.ts.snap
#	migration/index.spec.ts
#	migration/index.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Backward incompatible changes enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant