Anthony Skorupskyy
Anthony Skorupskyy
big issue for my project, i will try to take this on
I've created a small patch for my repo that adds support for v4. I haven't put in much effort into making sure this follows the most up-to-date practices, since in...
Yes, I am encountering this as well. I also do not like the approach mentioned in the docs, where you have to specify the `middleware` in `createRoute` call. It kind...
Hey @wfjsw I think I figured it out. What you need to do is create a router with env included, like: ```javascript const authRouter = new OpenAPIHono(); ``` Which on...
@Blankeos yeah that's how I do it. The other way is via `use()` but it applies to the route (all `GET`, `POST`, `PATCH`, etc) and not specific endpoint
I think in this case we'd want to return 400 if the request `content-type` is not in the router definition. ```typescript const me = createRoute({ request: { body: { content:...
```typescript if (c.req.header('content-type')) { if (isJSONContentType(c.req.header('content-type')!)) { return await validator(c, next) } } c.req.addValidatedData('json', {}) await next() ``` Although as far i understand, in this code segment we ignore that...
> I would challenge this statement. Depending on the business logic having undefined instead of a validated value might result in unexpected behaviour which could have security implications based on...
@hpohlmeyer the way that i do it is i separate the router and server part: ```typescript export const mainRouter = new OpenAPIHono() .basePath('/api/v1') .route('/auth', authRouter) .doc('/doc', {}) export type AppType...
Hi @Rick-Phoenix, yes, I've been using Zod along with `openapi-zod` package. I agree that Zod might be a part of a problem, but again, mostly due to Type Inference rather...