github-actions
released this
15 Dec 10:02
·
11 commits
to main
since this release
Minor Changes
-
#888
c63470e4915a0680c624bf97d52487572185a2d5
Thanks @miyaji255! - Enables handling ofnumber
,boolean
, andbigint
types in query parameters and headers.- import { typiaValidator } from '@hono/typia-validator'; + import { typiaValidator } from '@hono/typia-validator/http'; import { Hono } from 'hono'; import typia, { type tags } from 'typia'; interface Schema { - pages: `${number}`[]; + pages: (number & tags.Type<'uint32'>)[]; } const app = new Hono() .get( '/books', typiaValidator( - typia.createValidate<Schema>(), + typia.http.createValidateQuery<Schema>(), async (result, c) => { if (!result.success) return c.text('Invalid query parameters', 400); - return { pages: result.data.pages.map(Number) }; } ), async c => { const { pages } = c.req.valid('query'); // { pages: number[] } //... } )