group middlewares #3947
PandaWorker
started this conversation in
General
Replies: 1 comment 1 reply
-
Do you mean that this breaks validator types in the handler? If so, I have the same issue: import { validator } from 'hono-openapi/valibot';
import { every } from 'hono/combine';
router.post('/', validator('json', CreateAuthorSchema), async (c) => {
return c.json(create('authors', c.req.valid('json')), 201);
}); Works great. c.req.valid knows about json. However this doesn't work: import { validator } from 'hono-openapi/valibot';
import { every } from 'hono/combine';
router.post('/', every(validator('json', CreateAuthorSchema)), async (c) => {
return c.json(create('authors', c.req.valid('json')), 201);
}); I know this is a weird place to use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How can midwar be grouped so that the types don't break? I have a case where several routes need the same midwars, and I need to group them as a plugin and use it already, rather than specifying them every time.
Beta Was this translation helpful? Give feedback.
All reactions