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

Middleware & zod validator problem #743

Open
amit548 opened this issue Sep 20, 2024 · 4 comments
Open

Middleware & zod validator problem #743

amit548 opened this issue Sep 20, 2024 · 4 comments

Comments

@amit548
Copy link

amit548 commented Sep 20, 2024

image

I am trying to add prop value from middleware but when I use zValidator middleware to validate the param I found c.get & c.set showing some errors, I do the same without zValidator and I found c.get & c.set works well, I did not understand what wrong.

image

The defined types are missing after using zValidator for middleware.

@amit548
Copy link
Author

amit548 commented Sep 20, 2024

image

And also I want to clarify that I cannot use c.req.valid("param") so I did use c.req.param("vendor")

@amit548
Copy link
Author

amit548 commented Sep 20, 2024

image

image

And I also tried the hook way, but showing this type of error

@amit548
Copy link
Author

amit548 commented Sep 20, 2024

image

Well I created a normal middleware and it works, but looking for some solution for zValidator

@yusukebe
Copy link
Member

This is a known issue. Related to honojs/hono#3202

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

No branches or pull requests

2 participants