(schema: z.ZodTypeAny)
| 39 | } |
| 40 | |
| 41 | function getObjectShape(schema: z.ZodTypeAny): Record<string, z.ZodTypeAny> { |
| 42 | const shape = (schema as any).shape; |
| 43 | if (typeof shape === 'function') { |
| 44 | return shape(); |
| 45 | } |
| 46 | return shape ?? {}; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Generate JSON schema from Zod schema |