Closed Pietrohl closed 3 weeks ago
New dependencies detected. Learn more about Socket for GitHub ↗︎
Packages | Version | New capabilities | Transitives | Size | Publisher |
---|---|---|---|---|---|
@koa/bodyparser | 5.0.0 | None | +7 |
473 kB | fengmk2 |
@Pietrohl Thanks for your proposal, I think currently we are on the rethinking step about the router, and for sure this feature will be one of the points on our list. Maybe add your implementation as module to be a recipe under the recipes section on README.md can be a great option, like multi-verbs module here.
All what you need after publishing the small validation module, open issue and notify me.
In the meanwhile, If you really want the validation feature, I recommend you to use @koa-better-modules/joi-router
which is the up to date version of koa-joi-router
.
Checklist
Validation Schema to routes verb methods
This PR is to resolve the issue 170 for a possible new feature, to add a function overload to route[verb] function so it can accept a schema validation as second parameter.
Example usage: