Skip to content
New issue

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

zod-openapi example errors #147

Closed
Mcbeer opened this issue Sep 4, 2023 · 4 comments · Fixed by #148
Closed

zod-openapi example errors #147

Mcbeer opened this issue Sep 4, 2023 · 4 comments · Fixed by #148

Comments

@Mcbeer
Copy link

Mcbeer commented Sep 4, 2023

Following the examples linked: here

I get the following error:
Argument of type '(c: Context<Env, "/:id", { in: { param: { id: string; }; }; out: { param: { id: string; }; }; }>) => TypedResponse<{ id: string; age: number; name: string; }>' is not assignable to parameter of type 'Handler<Env, "/:id", { in: { param: { id: string; }; }; out: { param: { id: string; }; }; }, { id: string; name: string; age: number; }>'. Type 'TypedResponse<{ id: string; age: number; name: string; }>' is missing the following properties from type '{ id: string; name: string; age: number; }': id, name, age ts(2345)

It appears the TypedResponse helper type is causing this error
(I am quite new to OpenAPI, so this is all a bit arcane for me)

@majimaccho
Copy link

I got same error.
Here is the repo to reproduce.

https://github.com/macoto1995/hono-poc

@yusukebe
Copy link
Member

yusukebe commented Sep 5, 2023

Hi @Mcbeer , @macoto1995 !

This issue was fixed in new version hono/zod-openapi@0.3.0. Try it!

@majimaccho
Copy link

@yusukebe
Thank you for your quick fixing!
I confirmed it's now working in my repo ❤️

@Mcbeer
Copy link
Author

Mcbeer commented Sep 6, 2023

Sorry for the late reply @yusukebe - It is now confirmed working, thank you for your hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants