Skip to content

fix(validator): preserve handler name for telemetry and logs#115

Merged
sjorobekov merged 1 commit into
mainfrom
fix/withcontract-handler-name
May 12, 2026
Merged

fix(validator): preserve handler name for telemetry and logs#115
sjorobekov merged 1 commit into
mainfrom
fix/withcontract-handler-name

Conversation

@sjorobekov
Copy link
Copy Markdown
Contributor

Summary

Fixes an issue where withContract swallowed the wrapped handler's .name, causing all contracted routes to be logged and reported in telemetry as "finalHandler".

  • Adds operationId?: string to RouteContract (OpenAPI-canonical).
  • withContract now sets the wrapper's name to config.operationId || handler.name || ''.
  • Anonymous handlers without an operationId now correctly fall through to the router's UNNAMED_CONTROLLER fallback instead of leaking the internal "finalHandler" name.
  • Updated documentation and added tests.

@sjorobekov sjorobekov marked this pull request as ready for review May 12, 2026 11:01
@sjorobekov sjorobekov merged commit 790047a into main May 12, 2026
5 checks passed
@sjorobekov sjorobekov deleted the fix/withcontract-handler-name branch May 12, 2026 16:08
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.

3 participants