From 9481dc0e555dd05bbe710648f854d82154971fef Mon Sep 17 00:00:00 2001 From: Hans-Christian Otto Date: Fri, 23 Dec 2022 21:21:28 +0100 Subject: [PATCH] Do not expliclity type generated schemas This removes some features from the generated schemas. For example, `ZodType` lacks features from `ZodObject` such as `.pick`, or `.merge`. --- src/transformer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transformer.ts b/src/transformer.ts index 1a2a69b..9631744 100644 --- a/src/transformer.ts +++ b/src/transformer.ts @@ -290,7 +290,7 @@ export default class Transformer { name = `${name}Type`; } const end = `export const ${exportName}ObjectSchema = Schema`; - return `const Schema: z.ZodType = ${schema};\n\n ${end}`; + return `const Schema = ${schema};\n\n ${end}`; } addFinalWrappers({ zodStringFields }: { zodStringFields: string[] }) {