Emit type for enum dependencies of circular schemas, not just object dependencies
Enum dependencies of circular schemas weren't getting proper TypeScript type annotations (z.ZodType<T>), only object dependencies were. This resulted in enums being generated as const Status = z.enum([...]) instead of const Status: z.ZodType<Status> = z.enum([...]).
Root Cause: The template-context.ts logic only set emittedType: true for object dependencies (nodeSchema.type === "object") of circular schemas, but ignored enum dependencies.
Main fix: Extended the circular dependency processing in template-context.ts to also set emittedType: true for enum dependencies (nodeSchema.type === "string" && nodeSchema.enum).
Secondary fix: Fixed dependency detection in getOpenApiDependencyGraph.ts to handle union types like ["array", "null"] that were preventing some enum dependencies from being detected.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| openapi-zod-client-rim4 | Preview | Comment | Sep 24, 2025 5:11pm |