docs(zod-openapi): update the readme
parent
1bcd9624b1
commit
889338f3c7
|
@ -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',
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue