-
Notifications
You must be signed in to change notification settings - Fork 278
Open
Labels
Description
Which middleware has the bug?
@hono/zod-openapi
What version of the middleware?
"@hono/zod-openapi": "^1.1.5",
What version of Hono are you using?
"hono": "^4.10.6",
What runtime/platform is your app running on? (with version if possible)
Node
What steps can reproduce the bug?
import { serve } from "@hono/node-server";
import { swaggerUI } from "@hono/swagger-ui";
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
import { Scalar } from "@scalar/hono-api-reference";
const app = new OpenAPIHono();
app.openapi(
createRoute({
method: "get",
path: "/hello",
responses: {
200: {
description: "Respond a message",
content: {
"application/json": {
schema: z.object({
message: z.string(),
}),
},
},
},
},
}),
(c) => {
return c.json({
message: "hello",
});
},
);
app.doc("/doc", {
info: {
title: "An API",
version: "v1",
},
openapi: "3.1.0",
});
app.get("/", (c) => c.text("Hello world!"));
app.get("/hello", (c) => {
return c.json({
message2: "Hello world!",
});
});
app.get("/scalar", Scalar({ url: "/doc" }));
app.get("/swagger", swaggerUI({ url: "/doc" }));
serve({ fetch: app.fetch, port: 8080 }, (info) => {
console.log(`Listening on http://localhost:${info.port}`);
});What is the expected behavior?
No response
What do you see instead?
Additional information
No response