8 Replies
When I coerce the query to a number, Hono infers the type as
Record<string, string>
Is there a way to get the correct types without having to extract the zod schema?You should change from:
c.req.query()
to c.req.valid('query')
Reference:
- https://hono.dev/docs/guides/validationValidation - Hono
Ultrafast web framework for Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, Node.js, and others. Fast, but not only fast.
Thanks a lot
The tickets system is disabled for this server. Enable it at: https://yagpdb.xyz/manage/1011308539819597844/tickets/settings.
@Nico seems like this is not working
The tickets system is disabled for this server. Enable it at: https://yagpdb.xyz/manage/1011308539819597844/tickets/settings.
That’s a different command I haven’t set up a / command yet
Somehow related - when creating an RPC client (according to https://hono.dev/docs/guides/rpc#server) the app types will still contain query params as string instead of numbers in this case (even they're specified correctly with zValidator). Is there something that needs to be configured additionally, or is it a bug/limitation?
RPC - Hono
Ultrafast web framework for Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, Node.js, and others. Fast, but not only fast.