diff --git a/packages/core/src/utils/zod.ts b/packages/core/src/utils/zod.ts index 3d3b36c55..940fc4ab7 100644 --- a/packages/core/src/utils/zod.ts +++ b/packages/core/src/utils/zod.ts @@ -5,6 +5,7 @@ import { conditional } from '@silverhand/essentials'; import type { OpenAPIV3 } from 'openapi-types'; import type { ZodStringDef } from 'zod'; import { + ZodRecord, ZodArray, ZodBoolean, ZodEffects, @@ -201,6 +202,13 @@ export const zodTypeToSwagger = ( }; } + if (config instanceof ZodRecord) { + return { + type: 'object', + additionalProperties: zodTypeToSwagger(config.valueSchema), + }; + } + if (config instanceof ZodArray) { return { type: 'array',