Skip to content

Commit

Permalink
fix(zod): fix handling of additionalProperties in zod generator
Browse files Browse the repository at this point in the history
  • Loading branch information
ixth committed Jun 9, 2024
1 parent 6448cef commit b4692cc
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/zod/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ export const generateZodValidationSchemaDefinition = (
if (schema.additionalProperties) {
functions.push([
'additionalProperties',
isBoolean(schema.additionalProperties)
? schema.additionalProperties
: generateZodValidationSchemaDefinition(
schema.additionalProperties as SchemaObject,
context,
true,
name,
strict,
),
generateZodValidationSchemaDefinition(
isBoolean(schema.additionalProperties)
? {}
: (schema.additionalProperties as SchemaObject),
context,
true,
name,
strict,
),
]);

break;
Expand Down

0 comments on commit b4692cc

Please sign in to comment.