diff --git a/packages/typia-validator/README.md b/packages/typia-validator/README.md index b6482f889..4e0f68318 100644 --- a/packages/typia-validator/README.md +++ b/packages/typia-validator/README.md @@ -9,19 +9,19 @@ import typia, { tags } from 'typia' import { typiaValidator } from '@hono/typia-validator' interface Author { - name: string - age: number & tags.Type<'uint32'> & tags.Minimum<20> & tags.ExclusiveMaximum<100> - } - - const validate = typia.createValidate() - - const route = app.post('/author', typiaValidator('json', validate), (c) => { - const data = c.req.valid('json') - return c.json({ - success: true, - message: `${data.name} is ${data.age}`, - }) + name: string + age: number & tags.Type<'uint32'> & tags.Minimum<20> & tags.ExclusiveMaximum<100> +} + +const validate = typia.createValidate() + +const route = app.post('/author', typiaValidator('json', validate), (c) => { + const data = c.req.valid('json') + return c.json({ + success: true, + message: `${data.name} is ${data.age}`, }) +}) ``` Hook: