Skip to content

Commit 992ccdb

Browse files
committed
Merge remote-tracking branch 'origin/main' into deps
2 parents 5b1b2cf + a954c5d commit 992ccdb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/parse-procedure.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,11 @@ const getJsonSchemaConverters = (dependencies: Dependencies) => {
524524
if (ctx.zodSchema?.constructor?.name === 'ZodOptional') {
525525
ctx.jsonSchema.optional = true
526526
}
527+
528+
// this is needed because trpc-cli (currently) has its own zod dependency, which is v3, and uses zod/v4 as a submodule. But the v3 zod/v4 module drops descriptions from the produced json schema.
529+
// normally zod does this itself, but not when using v3's toJSONSchema function with a v4 schema.
530+
const meta = (ctx.zodSchema as {} as Partial<import('zod/v4').ZodType>).meta?.()
531+
if (meta) Object.assign(ctx.jsonSchema, meta)
527532
},
528533
}) as JSONSchema7
529534
}

0 commit comments

Comments
 (0)