Skip to content

fix(kitojs): correct route chaining overloads and fix schema application - #37

Merged
nehu3n merged 1 commit into
kitojs:mainfrom
skick1234:fix-route-chain
Dec 19, 2025
Merged

fix(kitojs): correct route chaining overloads and fix schema application#37
nehu3n merged 1 commit into
kitojs:mainfrom
skick1234:fix-route-chain

Conversation

@skick1234

Copy link
Copy Markdown
Contributor

Issue

  • Validation is not applied when using route chaining with (handler, schema)
app.route('/api/secure').get((ctx) => {
  ctx.res.send('Success');
}, schema({
  query: t.object({ token: t.str() })
}));

Changes

  • Used type narrowing to explicitly detect if the input is a handler or a schema, ensuring validation data always reaches the server.
  • Add test cases for route chaining

@nehu3n
nehu3n merged commit d61121f into kitojs:main Dec 19, 2025
2 checks passed
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