New issue
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
Validations error and wrong generation when referencing a namespace #208
Comments
Please fill in the "Expected output". Is the problem "just" the validation error? or something else? |
does this still occur in v.3.7.3? |
@schiller-manuel yes still happens also in v 3.7.3, the issue is just the validation error |
and did this work with previous versions? |
Looking at the actual output, it seems to me it should rather be: // Generated by ts-to-zod
import { z } from "zod";
export const comRiskifiedAvroAuditingprocessedV3ChangeTypeSchema = z.union([
z.literal("Create"),
z.literal("Delete"),
z.literal("Update"),
]);
export const comRiskifiedAvroAuditingprocessedV3AuditingProcessedSchema =
z.object({
entityType: z.string(),
entityId: z.string(),
adminUserEmail: z.string(),
createdAt: z.number(),
changeType: comRiskifiedAvroAuditingprocessedV3ChangeTypeSchema,
shopUrl: z.string().nullable(),
triggeringSource: z.string(),
beforeState: z.string(),
afterState: z.string(),
description: z.string(),
diff: z.string(),
auditingProcessedHash: z.string(),
});
export const auditingProcessedSchema =
comRiskifiedAvroAuditingprocessedV3AuditingProcessedSchema; in order to be valid. The |
Getting validation error when trying to generate from type with namespace
Input
Expected output
// Expected Zod schemas
Actual output
Versions
v3.7.1
v3.22.4
The text was updated successfully, but these errors were encountered: