-
-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typescript error with hono-openapi when upgrade hono to 4.6.17 #3884
Comments
|
@yusukebe actually, |
@palmithor How can I reproduce it? |
No response. I'll remove the |
I tried this with the latest version import { Hono } from "hono";
import { describeRoute, openAPISpecs } from "hono-openapi";
import { resolver, validator as zValidator } from "hono-openapi/zod";
import * as z from "zod";
const simple = z.object({
name: z.string(),
});
const app = new Hono();
const handler = describeRoute({
summary: "Get all campaigns",
responses: {
200: {
description: "List of campaigns",
content: {
"application/json": {
schema: resolver(simple),
},
},
},
},
operationId: "getCampaigns",
tags: ["campaign-manager"],
});
app.get(
"/",
zValidator(
"query",
z.object({
page: z.number().optional().default(1),
}),
),
handler,
async (c) => {
return c.text("Hello World");
},
);
app.get(
"/openapi",
openAPISpecs(app, {
documentation: {
info: {
title: "Hono",
version: "1.0.0",
description: "API for greeting users",
},
servers: [
{
url: "http://localhost:3000",
description: "Local server",
},
],
},
}),
); If you can share a reproduction of this on StackBlitz or CodeSandbox, that would be great. |
What version of Hono are you using?
4.6.17
What runtime/platform is your app running on? (with version if possible)
Bun workspace
What steps can reproduce the bug?
I am writing one api with hono, and openapi doc with hono-openapi.
The api like:
When I use hono v4.6.16 and hono-openapi v0.4.4, everything works well.
But after I upgrade the hono to v4.6.17 ~ v4.6.20(latest), there are a lot of type error occured in the
apiTool.post
method.What is the expected behavior?
No type error.
What do you see instead?
No response
Additional information
When I downgrade hono to 4.6.16, it works well.
The text was updated successfully, but these errors were encountered: