Open FlorianCassayre opened 1 month ago
Hello @FlorianCassayre,
Thanks for your request. Feel free to open a PR as this is quite a straightforward jump into the lib codebase I think 😉
In the meantime, you can also use the @schema
annotation to append the .int()
validator:
// Input
export type MyType = {
/**
* @schema .int()
*/
name: number;
};
// Output
// Generated by ts-to-zod
import { z } from "zod";
export const myTypeSchema = z.object({
name: z.number().int(),
});
Feature description
It would be useful if we could annotate a
number
as an integer (whole number).Input
For example:
Output