Skip to content

Commit 1bf53bb

Browse files
Copilotmrlubos
andcommitted
Fix TypeScript error in Zod v3 plugin for single-member enum optimization
Co-authored-by: mrlubos <[email protected]>
1 parent 59ea38e commit 1bf53bb

File tree

1 file changed

+1
-1
lines changed
  • packages/openapi-ts/src/plugins/zod/v3

1 file changed

+1
-1
lines changed

packages/openapi-ts/src/plugins/zod/v3/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ const enumTypeToZodSchema = ({
258258
});
259259
} else if (literalMembers.length === 1) {
260260
// For single-member unions, use the member directly instead of wrapping in z.union()
261-
enumExpression = literalMembers[0];
261+
enumExpression = literalMembers[0]!;
262262
} else {
263263
enumExpression = tsc.callExpression({
264264
functionName: tsc.propertyAccessExpression({

0 commit comments

Comments
 (0)