Skip to content

fix: align mapResponse and onAfterHandle with unified return types an… #1250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

combab0
Copy link

@combab0 combab0 commented Jun 9, 2025

Changes

  • Relaxed the return type of mapResponse to support primitive values (e.g. string, number), aligning its behavior with AfterHandler.
  • Updated onAfterHandle to use AfterHandler instead of OptionalHandler for consistency and clarity in handler semantics.

Motivation

This change improves the developer experience by making the behavior of response handlers more predictable and flexible. It also eliminates subtle inconsistencies between mapResponse and onAfterHandle.

No breaking changes expected for users following the current type contracts.

@SaltyAom
Copy link
Member

Unfortunately, I don't think this will work

As mapResponse is expected to return a Response

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.

2 participants