Skip to content

Using Hono RPC & Zod OpenAPI & Deno & React? #3444

Closed Answered by p8952
p8952 asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to resolve this 🎉

Create api/src/deno.json:

{
  "lock": false,
  "imports": {
    "@hono/zod-openapi": "npm:@hono/zod-openapi@0.16.0",
    "hono/cors": "npm:hono@4.5.11/cors"
  }
}

Update api/src/index.ts:

import { OpenAPIHono } from "@hono/zod-openapi";
import { cors } from "hono/cors";

Update api/src/routes/testRoute.ts:

import { createRoute, type RouteHandler, z } from "@hono/zod-openapi";

Update web/tsconfig.app.json:

/* Deno Types */
"paths": {
  "@hono/zod-openapi": ["./node_modules/@hono/zod-openapi"],
  "hono/": ["./node_modules/hono/"]
}

Update web/package.json:

"dependencies": {
  "@hono/zod-openapi": "=0.16.0",
  "hono": "=4.5.11",
  "react": "^18.3.1",
  "react-…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@yusukebe
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by p8952
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants