From 9c72b3ebcc3c1f593399bfa8dad10aa9d637c233 Mon Sep 17 00:00:00 2001 From: Andrii Balitskyi <10balian10@gmail.com> Date: Wed, 17 Jul 2024 10:56:37 +0200 Subject: [PATCH] Remove comment --- .../src/generators/lib/zod-openapi.ts | 50 ------------------- 1 file changed, 50 deletions(-) diff --git a/packages/nextlove/src/generators/lib/zod-openapi.ts b/packages/nextlove/src/generators/lib/zod-openapi.ts index a7ba345ae..7825c03c7 100644 --- a/packages/nextlove/src/generators/lib/zod-openapi.ts +++ b/packages/nextlove/src/generators/lib/zod-openapi.ts @@ -629,56 +629,6 @@ const workerMap = { } type WorkerKeys = keyof typeof workerMap -/** - * Parsing a nested `.describe(...)` doesn't work correctly. - * Example of such zod schema: - * - * arrayDesciption: z - .array( - z.object({}).describe(` - --- - title: Nested Object Description - --- - This is an object. - `) - ) - .optional().describe(` - --- - title: Array Description - --- - This is an array of strings. - `), - - * Such schema will be parsed as: - - "arrayDesciption": { - "type": "array", - "items": { - "type": "object", - "properties": {}, - "description": "\n ---\n title: Nested Object Description\n ---\n This is an object.\n " - }, - "description": "This is an array of strings.", - "x-title": "Array Description" - }. - - We can see that description body and front matter doesn't get parsed in nested `z.object().describe(...)` inside `z.array()`. - - Instead such nested description should look like this: - - "arrayDesciption": { - "type": "array", - "items": { - "type": "object", - "properties": {}, - "description": "This is an object." - "x-title": "Nested Object Description" - }, - "description": "This is an array of strings.", - "x-title": "Array Description" - }. - */ - export function generateSchema( zodRef: OpenApiZodAny, useOutput?: boolean