-
Notifications
You must be signed in to change notification settings - Fork 101
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
Possible enhancement for @hono/typebox-validator ? #400
Comments
Hi @otma2677 I'm sorry for my late response! That makes sense. You can create a PR.
Fyi. The API of Validator is changed from I explained in #91 though it may be what you want. |
In advance, sorry if my issue is not appropriate, either because it is a duplicate (not seen any), or if I have miss something, I'm an aspiring web developer and quite new to that world.
I'm actually using @hono/typebox-validator and I've found that in the case of param validation, I cannot type the params with something else than string, which is understandable, like explained in the issue #91 by @yusukebe
I've seen that with zod, transform types will automatically convert values after the validation, while with Typebox, you need to use "Value.Decode()" after the check to get the transformed data, so it would be cool to have it doing that by default, as follow;
From
To
Or maybe even another dedicated function specifically for case you use Transform values ?
Which means that now we would get back decoded values;
Maybe the behavior is expected to be that way and I have missed something ? If not, I want to create a pull request for that, would it be ok ? I feel like its doable for me.
I've tried locally (modifying directly the dependency) and its nice, maybe adding some checks (if the string cannot be converted, it becomes null) would be good too ?
The text was updated successfully, but these errors were encountered: