zod
zod copied to clipboard
how can i transform class-validator + class-transfomer to zod?
import {Type} from 'class-transfomer';
import {IsNumber} from 'class-validator';
class TestDto {
@IsNumber()
@Type(() => Number)
a: number;
}
I can input { a: '123' } , and then output { a: 123 } with class-validator,although the type of a does not match,so how can I use zod to describe this case?
zod.preprocess I think after reading the docs ;)