We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ts-to-zod v3.0.0 generates a Zod schema that fails type verification with this error:
2339: Property 'shape' does not exist on type 'ZodType<test, ZodTypeDef, test>'.
Looking into the ZodType (exported as ZodSchema) definition it in fact doesn't have any field called shape.
ZodType
ZodSchema
shape
The input file is generated by openapi-typescript v6.2.0 but I could reproduce the issue with a type definition as simple as this:
openapi-typescript
// typescript type or interface causing the output export interface test { schemas: { A: string | null; B: test['schemas']['A'][]; }; }
Not exactly sure ...
// Actual Zod schemas // Generated by ts-to-zod import { z } from 'zod'; import { test } from './test.d'; export const testSchema: z.ZodSchema<test> = z.lazy(() => z.object({ schemas: z.object({ A: z.string().nullable(), B: z.array(testSchema.shape.schemas.shape.A), }), }), );
Versions
v4.9.5
v3.21.4
The text was updated successfully, but these errors were encountered:
Hi, any update ?
Sorry, something went wrong.
Btw, this issue is not relevant to me anymore since we switched from openapi-typescript + ts-to-zod to openapi-zod-client.
No branches or pull requests
Bug description
ts-to-zod v3.0.0 generates a Zod schema that fails type verification with this error:
Looking into the
ZodType
(exported asZodSchema
) definition it in fact doesn't have any field calledshape
.Input
The input file is generated by
openapi-typescript
v6.2.0 but I could reproduce the issue with a type definition as simple as this:Expected output
Not exactly sure ...
Actual output
Versions
v4.9.5
v3.21.4
The text was updated successfully, but these errors were encountered: