We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
First of all, thank you for developing this exceptional library, it's a pleasure to work with!
However, I'm having a problem integrating hono/client, perhaps I'm missing something?
hono/client
With new Hono() rpc works :
new Hono()
// main.tsx const hono = new Hono().get( '/api/v1/users/:id', validator('param', (v) => z.object({ id: z.string().min(3) }).parse(v)), (c) => { const { id } = c.req.valid('param') return c.json({ id, age: 20, name: 'Ultra-man', }) }, ) export type HonoRpc = typeof hono
With new OpenAPIHono() rpc path is incorrect (it take only first part) :
new OpenAPIHono()
// main.tsx const openapiHono = new OpenAPIHono().openapi( { method: 'get', path: '/api/v1/users/{id}', request: { params: z.object({ id: z .string() .min(3) .openapi({ param: { name: 'id', in: 'path', }, example: '1212121', }), }), }, responses: { 200: { content: { 'application/json': { schema: z .object({ id: z.string().openapi({ example: '123', }), name: z.string().openapi({ example: 'John Doe', }), age: z.number().openapi({ example: 42, }), }) .openapi('User'), }, }, description: 'Retrieve the user', }, }, }, (c) => { const { id } = c.req.valid('param') return c.json({ id, age: 20, name: 'Ultra-man', }) }, ) export type OpenapiHonoRpc = typeof openapiHono
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
First of all, thank you for developing this exceptional library, it's a pleasure to work with!
However, I'm having a problem integrating
hono/client
, perhaps I'm missing something?With
new Hono()
rpc works :With
new OpenAPIHono()
rpc path is incorrect (it take only first part) :The text was updated successfully, but these errors were encountered: