docs(zod-openapi): update the readme

pull/136/head
Yusuke Wada 2023-08-23 11:49:32 +09:00
parent 1bcd9624b1
commit 889338f3c7
1 changed files with 3 additions and 3 deletions

View File

@ -63,7 +63,7 @@ import { createRoute } from '@hono/zod-openapi'
const route = createRoute({ const route = createRoute({
method: 'get', method: 'get',
path: '/users/:id', path: '/users/{id}',
request: { request: {
params: ParamsSchema, params: ParamsSchema,
}, },
@ -134,7 +134,7 @@ Then, add the error response:
```ts ```ts
const route = createRoute({ const route = createRoute({
method: 'get', method: 'get',
path: '/users/:id', path: '/users/{id}',
request: { request: {
params: ParamsSchema, params: ParamsSchema,
}, },
@ -159,7 +159,7 @@ app.openapi(
(c) => { (c) => {
const { id } = c.req.valid('param') const { id } = c.req.valid('param')
return c.jsonT({ return c.jsonT({
id: Number(id), id,
age: 20, age: 20,
name: 'Ultra-man', name: 'Ultra-man',
}) })